美文网首页
Node JS 微服务网关Express Gateway

Node JS 微服务网关Express Gateway

作者: 寻找无名的特质 | 来源:发表于2023-11-13 05:51 被阅读0次

首先安装express gateway:
npm install -g express-gateway
找一个干净的目录创建一个 EG 网关项目:
eg gateway create
安装完成后,进入安装目录,修改gateway.config.yml,增加配置
增加serviceEndpoints:
serviceEndpoints:
local-service:
url:'http://127.0.0.1:8888'
增加apiEndpoints:
client-demo:
paths:["/api","/api/*"]
增加pipelines:
pipelines:
local-pipeline:
apiEndpoints:
- client-demo
policies:
- proxy:
- action:
serviceEndpoint: local-service
changeOrigin: true

使用npm start运行

相关文章

网友评论

      本文标题:Node JS 微服务网关Express Gateway

      本文链接:https://www.haomeiwen.com/subject/mqnqwdtx.html