I couldn't find a way to make logging conditional on NODE_ENV
other than to create a custom condition like this.
In the condition file:
handler: (conditionConfig) => () => (
process.env[conditionConfig.variableName] === conditionConfig.expected
)
In the gateway config:
- log:
- condition:
name: not
condition:
name: environment-variable-match
variableName: NODE_ENV
expected: test
Am I doing this the hard way? If not, should I publish this as a tiny plugin?
how to translate xml to json using express gateway
https://www.npmjs.com/package/xml2json + custom EG plugin = community contribution :) @Wassemoo (https://github.com/ExpressGateway/express-gateway-plugin-example)
eg apps create
, but what is the client secret? Is /oauth2/token giving me a 401 (no authorization) because I didn't sent a client secret?
http:
port: 8080
admin:
port: 9876
host: localhost
apiEndpoints:
authAPI:
host: localhost
paths:
- '/users/signin'
- '/users/signup'
- '/users/oauth/facebook'
- '/users/auth/google'
- '/users/auth/google/callback'
- '/users/secret'
- '/users/get-user-google'
- '/dashboard'
crudAPI:
host: localhost
paths:
- '/users/get-user-data'
- '/users/delete-user-data'
- '/users/add-user-data'
- '/users/get-one-user-data/*'
- '/users/update-user-data'
- '/users/update-pass-user-data'
serviceEndpoints:
authService:
url: 'http://localhost:3003'
crudService:
url: 'http://localhost:3004'
policies:
- log
- oauth2
- proxy
- jwt
pipelines:
crud:
apiEndpoints:
- crudAPI
policies:
- log:
- action:
message: "here"
- jwt:
- action:
secretOrPublicKey: secretAuth
checkCredentialExistence: false
# passThrough: true
- proxy:
- action:
serviceEndpoint: crudService
changeOrigin: true
auth:
apiEndpoints:
- authAPI
policies:
- log:
- action:
message: "here auth"
- proxy:
- action:
serviceEndpoint: authService