https://github.com/microcmpt/msa-api-gateway
The service API gateway, which uniformly receives external requests, performs load balancing to invoke the back-end service and returns the results.
https://github.com/microcmpt/msa-api-gateway
express http-proxy node-zookeeper-client nodejs
Last synced: 2 months ago
JSON representation
The service API gateway, which uniformly receives external requests, performs load balancing to invoke the back-end service and returns the results.
- Host: GitHub
- URL: https://github.com/microcmpt/msa-api-gateway
- Owner: microcmpt
- Created: 2018-05-13T02:19:18.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-31T09:19:49.000Z (about 8 years ago)
- Last Synced: 2025-09-18T04:58:22.497Z (10 months ago)
- Topics: express, http-proxy, node-zookeeper-client, nodejs
- Language: JavaScript
- Homepage: https://github.com/msa-component/msa-api-gateway
- Size: 3.37 MB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# msa-api-gateway
## Installation
```bash
npm i msa-api-gateway
```
## Quick Start
step1:找到服务网关根目录下的zk_app.js文件,配置里面服务注册中心地址:
```$xslt
CONNECTION_STRING=你的zookeeper地址,多个以,分割
```
step2:启动服务网关
```$xslt
pm2 start zk_app.js
```
step3:发送http请求
```$xslt
curl -H 'Application-Name:sampleConsumer' http://localhost:1025/api/hello/123
```
> Application-Name:注册到注册中心时的应用名