Api文档管理工具Yapi的搭建

2018-04-08  本文已影响63人  海的原滋味

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
上一篇下一篇

猜你喜欢

热点阅读