Express Gateway Documentation
Express Gateway exposes microservices as APIs through URLs known as apiEndpoints. API consumers may make API requests through the API endpoints.
apiEndpoints: help: # name, used as reference in pipeline host: '*' # required, '*' will not check for host name paths: /help # optional, by default will serve all requests - same as * api: # name, used as reference in pipeline host: '*.com' # wildcard pattern support paths: - '/v1/*' # string or array of strings - '/v2/*' example: # name, used as reference in pipeline host: 'example.com' paths: /v2/* # string or array of strings example2: # It is possible to provide an array of matching conditions in the same apiEndpoint - host: 'example2.com' paths: /v2/* methods: ["GET", "OPTIONS"] scopes: ["example2:read"] - host: 'example2.com' paths: /v2/* methods: ["PUT", "POST", "PATCH", "DELETE"] scopes: ["example2:write"]
||the hostname to accept requests on|
||an array of paths|
||an array of methods required to accept requests on|
||an array of scopes required to access such resource|
host value is a string that will be matched against the ‘HOST’ header of the request.
Any Domain and Path
apiEndpoints: help: host: '*' paths: /help
One Domain with No Subdomains and Path
apiEndpoints: help: host: 'example.com' paths: /help
Any 1st Level Subdomain of One Domain and Path
apiEndpoints: help: host: '*.example.com' paths: /help
Paths can be either a string or array of strings. Wildcard patterns are supported. Paths follow the ExpressJS routes conventions - https://expressjs.com/en/4x/api.html#router
Exact String Match
Deep Level Match without Parent
Deep Level Match with Parent
One Level Match without Parent with Variable Assignment
Multi level Sub Dir Match without Parent with Variable Assignments
- match: /admin/ops/bob
- group: ops
- id: bob
- 404: /admin; /admin/bob; /admin/alex/bob/charlie
Multi Multiple Level Sub Dir Match without Parent
paths: ['/student/*', '/teacher/*','/admin/*']
The order of the API endpoints specified matters. It is possible to specifiy overlapping patterns through wildcards. More specific patterns should be specified first for prioritized evaluation before more general matching.
apiEndpoints: tabby: host: '*.tabby.cat.com' paths: '*' # optional, if not specified will default to * cat: host: '*.cat.com' com: host: '*.com'
scopes value is an array of strings that specifies the required scopes that the current credential needs to have
in order to access the resource.
apiEndpoints: tabby: host: '*.tabby.cat.com' paths: '*' scopes: - read - write - delete
The following api endpoint will be accesible only if the current user has