1.安裝并啟動MangoDB
brew install mongodb
brew services start mongodb
2.安裝YAPI
# cd ~/workspace
# mkdir yapi && cd yapi
# git clone https://github.com/YMFE/yapi.git vendors --depth=1
3.修改默認配置
# cp vendors/config_example.json ./config.json
# vim ./config.json
{
"port": "3000",
"adminAccount": "admin@admin.com",
"db": {
"servername": "127.0.0.1",
"DATABASE": "yapi",
"port": 27017,
"user": "test1",
"pass": "test1"
},
"mail": {
"enable": true,
"host": "smtp.163.com",
"port": 465,
"from": "***@163.com",
"auth": {
"user": "***@163.com",
"pass": "*****"
}
}
}
4.安裝依賴
# cd vendors
# npm install --production --registry https://resgistry.npm.taobao.org
5.初始化
`# npm run install-server`
6.啟動服務
`# node server/app.js >> yapi.log 2>&1 &`
7.瀏覽器驗證
URL:127.0.0.1:3000/login
用戶名:admin@admin.com
密碼:ymfe.org