Skip to content

Instantly share code, notes, and snippets.

@NomadXD
Created April 3, 2021 07:40
Show Gist options
  • Save NomadXD/05956bfe4158fee674d22fb7078cc5bb to your computer and use it in GitHub Desktop.
Save NomadXD/05956bfe4158fee674d22fb7078cc5bb to your computer and use it in GitHub Desktop.
gateway.yaml for express-gateway config
http:
port: 8080
admin:
port: 9876
host: localhost
apiEndpoints:
noAuth:
host: '*'
paths:
- '/api/user/signup'
- '/api/user/signin'
- '/api/user/check/:userId'
methods: ["POST","GET"]
user:
host: '*'
paths:
- '/api/user/update'
- '/api/user/delete'
- '/api/user/:userId'
- '/api/user/update'
- '/api/user/change-password'
methods: ["GET","POST","PUT","DELETE","OPTIONS"]
gov_no_auth:
host: '*'
paths:
- '/api/gov/signup'
- '/api/gov/signin'
- '/api/gov/get-all'
methods: ["GET","POST","PUT","DELETE","OPTIONS"]
gov_auth:
host: '*'
paths:
- '/api/gov/get-institute-info'
- '/api/gov/hq/get-unverified'
- '/api/gov/hq/verify/:instituteId'
- '/api/gov/update/contact'
- '/api/gov/update/location'
- '/api/gov/update/info'
- '/api/gov/update/change-password'
- '/api/gov/analytics/token'
- '/api/gov/analytics/date'
- '/api/gov/analytics/province'
- '/api/gov/analytics/day'
- '/api/gov/analytics'
methods: ["GET","POST","PUT","DELETE","OPTIONS"]
socket:
host: '*'
paths:
- '/api/socket/broadcast'
- '/api/socket/test'
- '/api/socket/send-message'
methods: ["GET","POST","PUT","DELETE","OPTIONS"]
push:
host: '*'
paths:
- '/api/push/send'
- '/api/push/send-all'
- '/api/push/save-location'
- '/api/push/get-messages'
methods: ["GET","POST","PUT","DELETE","OPTIONS"]
serviceEndpoints:
noAuthService:
url: 'http://uds:3000'
socketService:
url: 'htpp://socket:3000'
govNoAuthService:
url: 'http://gov_auth:3000'
govAuthService:
url: 'http://gov_auth:3000'
pushService:
url: 'http://push:3000'
policies:
- log
- proxy
- jwt
- request-transformer
- terminate
- cors
pipelines:
noAuth:
apiEndpoints:
- noAuth
policies:
- cors:
- action:
origin: '*'
credentials: true
allowedHeaders: ['Content-type','Authorization','Origin','Access-Control-Allow-Origin','Accept','Options','X-Requested-With']
exposedHeaders: ['Content-type','Authorization','Origin','Access-Control-Allow-Origin','Accept','Options','X-Requested-With']
#exposedHeaders : ['Content-type','Authorization','Origin','Access-Control-Allow-Origin','Origin', 'Accept', 'X-Requested-With', 'Content-Type', 'Access-Control-Request-Method', 'Access-Control-Request-Headers','Authorization', 'Access-Control-Allow-Origin','X-TEST']
preflightContinue: false
optionsSuccessStatus: 204
#maxAge: 600
- proxy:
- action:
serviceEndpoint: noAuthService
user:
apiEndpoints:
- user
policies:
- cors:
- action:
origin: '*'
credentials: true
methods: GET,POST,PUT,DELETE,OPTIONS
allowedHeaders: ['Content-type','Authorization','Origin','Access-Control-Allow-Origin','Accept','Options']
exposedHeaders: ['Content-type','Authorization','Origin','Access-Control-Allow-Origin','Accept','Options']
#exposedHeaders : ['Content-type','Authorization','Origin','Access-Control-Allow-Origin','Origin', 'Accept', 'X-Requested-With', 'Content-Type', 'Access-Control-Request-Method', 'Access-Control-Request-Headers','Authorization', 'Access-Control-Allow-Origin','X-TEST']
preflightContinue: false
optionsSuccessStatus: 204
#maxAge: 600
- jwt:
- action:
secretOrPublicKey: 'secret'
checkCredentialExistence: false
- request-transformer:
- action:
body:
add:
user: req.user
- proxy:
- action:
serviceEndpoint: noAuthService
socket:
apiEndpoints:
- socket
policies:
- cors:
- action:
origin: '*'
credentials: true
methods: GET,POST,PUT,DELETE,OPTIONS
allowedHeaders: ['Content-type','Authorization','Origin','Access-Control-Allow-Origin','Accept','Options']
exposedHeaders: ['Content-type','Authorization','Origin','Access-Control-Allow-Origin','Accept','Options']
#exposedHeaders : ['Content-type','Authorization','Origin','Access-Control-Allow-Origin','Origin', 'Accept', 'X-Requested-With', 'Content-Type', 'Access-Control-Request-Method', 'Access-Control-Request-Headers','Authorization', 'Access-Control-Allow-Origin','X-TEST']
preflightContinue: false
optionsSuccessStatus: 204
#maxAge: 600
- jwt:
- action:
secretOrPublicKey: 'secret'
checkCredentialExistence: false
- request-transformer:
- action:
body:
add:
token: req.user
- proxy:
- action:
serviceEndpoint: socketService
gov_auth:
apiEndpoints:
- gov_auth
policies:
- cors:
- action:
origin: '*'
credentials: true
methods: GET,POST,PUT,DELETE,OPTIONS
allowedHeaders: ['Authorization','Content-type','Origin','Access-Control-Allow-Origin','Accept','Options','Access-Control-Request-Headers','Access-Control-Request-Method']
exposedHeaders: ['Content-type','Origin','Access-Control-Allow-Origin','Accept','Options','Access-Control-Request-Headers','Access-Control-Request-Method']
#exposedHeaders : ['Content-type','Authorization','Origin','Access-Control-Allow-Origin','Origin', 'Accept', 'X-Requested-With', 'Content-Type', 'Access-Control-Request-Method', 'Access-Control-Request-Headers','Authorization', 'Access-Control-Allow-Origin','X-TEST']
preflightContinue: false
optionsSuccessStatus: 204
#maxAge: 600
- jwt:
- action:
secretOrPublicKey: 'secret'
checkCredentialExistence: false
- request-transformer:
- action:
body:
add:
token: req.user
- proxy:
- action:
serviceEndpoint: govAuthService
gov_no_auth:
apiEndpoints:
- gov_no_auth
policies:
- cors:
- action:
origin: '*'
credentials: true
methods: GET,POST,PUT,DELETE,OPTIONS
allowedHeaders: ['Content-type','Authorization','Origin','Access-Control-Allow-Origin','Accept','Options']
exposedHeaders: ['Content-type','Authorization','Origin','Access-Control-Allow-Origin','Accept','Options']
#exposedHeaders : ['Content-type','Authorization','Origin','Access-Control-Allow-Origin','Origin', 'Accept', 'X-Requested-With', 'Content-Type', 'Access-Control-Request-Method', 'Access-Control-Request-Headers','Authorization', 'Access-Control-Allow-Origin','X-TEST']
preflightContinue: false
optionsSuccessStatus: 204
#maxAge: 600
- proxy:
- action:
serviceEndpoint: govNoAuthService
push:
apiEndpoints:
- push
policies:
- cors:
- action:
origin: '*'
credentials: true
methods: GET,POST,PUT,DELETE,OPTIONS
allowedHeaders: ['Authorization','Content-type','Origin','Access-Control-Allow-Origin','Accept','Options','Access-Control-Request-Headers','Access-Control-Request-Method']
exposedHeaders: ['Content-type','Origin','Access-Control-Allow-Origin','Accept','Options','Access-Control-Request-Headers','Access-Control-Request-Method']
#exposedHeaders : ['Content-type','Authorization','Origin','Access-Control-Allow-Origin','Origin', 'Accept', 'X-Requested-With', 'Content-Type', 'Access-Control-Request-Method', 'Access-Control-Request-Headers','Authorization', 'Access-Control-Allow-Origin','X-TEST']
preflightContinue: false
optionsSuccessStatus: 204
#maxAge: 600
- jwt:
- action:
secretOrPublicKey: 'secret'
checkCredentialExistence: false
- request-transformer:
- action:
body:
add:
token: req.user
- proxy:
- action:
serviceEndpoint: pushService
@philipsjp26
Copy link

is issue solved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment