# YApi部署 ### 环境 Ubuntu 18.04 YApi v1.5.13 ### 部署过程(可视化安装) ```shell apt install npm npm install -g yapi-cli --registry https://registry.npm.taobao.org yapi server # 启动应用 node vendors/server/app.js ``` 部署完成之后,可按照提示信息,执行 node/{网站路径/server/app.js} 启动服务器。在浏览器打开指定url, 点击登录输入您刚才设置的管理员邮箱,默认密码(ymfe.org) 登录系统(默认密码可在个人中心修改) ### YApi后台启动 1. 安装pm2 ```shell npm install -g pm2 ``` 2. pm2相关命令 ```shell # 运行列表 pm2 list # 重启列表所有应用 pm2 restart all # 启动指定的进程,如:进程 0 pm2 start 0 # 关闭指定的进程 pm2 stop 0 ``` 3. yapi后台启动 ```shell pm2 start vendors/server/app.js --name yapi ```