使用NodeJS做微服务网关,代理SpringCloud微服务请求,服务治理通过Zookeeper集群获取。

安装node.js
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -

yum install -y nodejs

node -v

npm install cnpm -g --registry=https://registry.npm.taobao.org
网关服务目录
/opt/gateway-api
安装依赖
cd /opt/gateway-api

npm install log4js

npm install express

npm install node-zookeeper-client

npm install http-proxy

npm install cluster

npm install os

npm install forever -g
启动
forever start app.js
停止
forever stop app.js
日志
~/.forever/
查看最新日期的log文件

猜你喜欢

转载自blog.csdn.net/weixin_43876684/article/details/104894759