前言
本文首发公众号 【一名打字员】
网上墙内关于这方面的文章真的很少,本猿也是通过官网一点一点学习,希望能够帮助到大家。express-gateway官网
安装
- 安装Express Gateway
npm install -g express-gateway
- 创建一个项目
eg gateway create
- 初始一些基本信息配置
eg gateway create
? What is the name of your Express Gateway? my-gateway
? Where would you like to install your Express Gateway? my-gateway
? What type of Express Gateway do you want to create? (Use arrow keys)
❯ Getting Started with Express Gateway
Basic (default pipeline with proxy)
- 启动
cd my-gateway && npm start
这样基本的一个项目就已经成型了。
使用方法
指定服务并把API暴露出来(API提供者)
- 第一步
我们会发现,项目中已经把代理了一个现有的服务 https://