/express-gateway-plugin-cookie-parser

Add express cookie-parser middleware to express-gateway

Primary LanguageJavaScriptMIT LicenseMIT

express-gateway-plugin-cookie-parser

Add express cookie-parser middleware to express-gateway

Usage

# system.config.yml
plugins:
    express-gateway-plugin-cookie-parser:
        package: 'express-gateway-plugin-cookie-parser'
# gateway.config.yml
pipelines:
  api:
    policies:
      - proxy:
        - condition:
            name: expression
            expression: "req.cookies.username === 'admin'"

With advanced configuration:

# system.config.yml
plugins:
    express-gateway-plugin-cookie-parser:
        package: 'express-gateway-plugin-cookie-parser'
        secret: 'my-secret'
        option:
          desc1: 'An object that is passed to cookie.parse as the second option.'
          desc2: 'See https://www.npmjs.com/package/cookie for more information.'