roit-api-gateway-register
v0.0.8
Published
ROIT api gateway register ========================
Downloads
73
Maintainers
Readme
ROIT api gateway register
How to use?
Step 1: configure your routers
# Name default gateway-config.yaml
default:
apiGatewayHost: # Base host of service
dev: http://dev:7001
hom: http://hom:7001
prod: http://prod:7001
serviceName: service-test # Application/Module name
routers: # List routers for register
pig: # Router name
router: /api/v1/pig # Router description
envs: # List envs
dev: # Env
baseUrl: https://pig-service-dev # Base url of env
prod:
baseUrl: https://pig-service-prod
galinha:
router: /api/v1/galinha
envs:
dev:
baseUrl: https://galinha-service-dev
prod:
baseUrl: https://galinha-service-prod
bird:
router: /api/v1/bird
envs:
dev:
baseUrl: https://bird-service-dev
prod:
baseUrl: https://bird-service-prod
import { RegisterService } from 'roit-api-gateway-register';
// Register routers in gateway
RegisterService.getInstance().registerRouters()
"scripts": {
"register-dev": "node ./node_modules/roit-api-gateway-register/dist/src/RunDev.js",
"register-hom": "node ./node_modules/roit-api-gateway-register/dist/src/RunHom.js",
"register-prod": "node ./node_modules/roit-api-gateway-register/dist/src/RunProd.js",
}