首页 > Windows开发 > 详细

Yapi本地搭建及错误解决

时间:2020-02-21 12:51:45      阅读:1208      评论:0      收藏:0      [点我收藏+]

参考 https://www.jianshu.com/p/5bda5556c149

安装 Mongo并启动

安装yapi-cli

npm install -g yapi-cli

启动

yapi server

浏览器打开

http://0.0.0.0:9090/

  • 问题1:初始化数据库报错
    Error: (node:90198) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.

技术分享图片

解决方法
cd ~/my-yapi/vendors
vim exts/server/utils.js 22行 添加 useUnifiedTopology: true

 let options = {useNewUrlParser: true, useCreateIndex: true, useUnifiedTopology: true};

参考官网的命令行部署方式 https://hellosean1025.github.io/yapi/devops/index.html

npm run install-server
  • 问题2:初始化管理员账号失败

技术分享图片

解决方法:删除mongodb数据库中已创建的管理员数据,重新运行
技术分享图片

初始化管理员账号成功,账号名:"superhin@126.com",密码:"ymfe.org"

启动服务

cd  ~/my-yapi
node vendors/server/app.js

访问网站

http://127.0.0.1:3000/ 使用账号 密码登录即可
技术分享图片

官方使用教程:https://hellosean1025.github.io/yapi/

接口请求插件安装

技术分享图片

  • 点击[点击下载]连接,解压下载的crossRequest.zip得到cross-request.crx
  • 修改cross-request.crx后缀名为.rar,解压后得到cross-request目录
  • 浏览器打开chrome://extensions/,打开开发者模式,点击 加载已解压的扩展程序,选择cross-request目录即可

技术分享图片

Yapi本地搭建及错误解决

原文:https://www.cnblogs.com/superhin/p/12340560.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!