npm install coro-api支持express任意版本
- git任意版本
$3
`
$ git clone https://github.com/iotcat/coro-api.git & cd coro-api
`
$3
`shell
$ npm install
`
$3
`shell
$ node index.js
`
$3
`
http://localhost:17676
`
进阶
$3
参数 | 描述 | 示例
:--: | :--: | :--:
province | 省份(国家) | 山东
city | 城市 | 泰安
$3
从index.js第9行修改默认端口。
$3
注释掉index.js第13行。
$3
`shell
$ npm i -g pm2
$ pm2 start index.js --name coro-api -o /var/log/coro/api.out -e /var/log/coro/api.err --watch
`
$3
将以下内容加入server{}中
`nginx
location / {
proxy_pass http://127.0.0.1:17676;
}
`
如果你不是从根目录映射,记得去index.js中第11行app.get('/', f)`修改成你的路径。