API Gateway is service that handle all request from client and forward to any services. More detail about API Gateway, you can see here.
RequTrap will help you in implementing API Gateway. It is simple and fast, you can use it easily, sure.
You can configure RequTrap by creating a YAML file which contain configuration schema. It will look like example below.
name: book-store
host: 127.0.0.1
port: 8080
services:
- path: /books
upstream: http://127.0.0.1:8001
- path: /authors
upstream: http://127.0.0.1:8002
.
.
.
If you want to configure CORS, just put example bellow at bottom of YAML configuration file.
.
.
.
cors:
enable: true
methods:
- GET
- POST
- PUT
- DELETE
origins:
- http://localhost:3000
.
.
.
If your authentication service using JWT (JSON Web Token), just give little information on API gateway config.
.
.
.
authentication:
type: jwt
upstream: http://localhost:8000
.
.
.
requtrap start [path/to/configuration.yml]
requtrap stop [gateway-name]
requtrap help [command]
Please make sure to read the Contributing Guide before making a pull request.