首页 > 其他 > 详细

swagger 服务搭建

时间:2017-11-20 14:21:53      阅读:375      评论:0      收藏:0      [点我收藏+]

初始环境

  • 大于 Node 6.x
  • 大于 NPM 3.x
  • 需要把以下两个包放部署在http服务下
    swagger-editor ( API 编辑 )
    swagger-ui ( API 查看 )

swagger-editor ( API 编辑 )

git clone https://github.com/swagger-api/swagger-editor.git
cd swagger-editor
npm install
npm run build
npm start
访问 编辑页面

http://localhost:8080/swagger-editor/index.html

swagger-ui ( API 查看 )

git clone https://github.com/swagger-api/swagger-ui.git
cd swagger-editor
npm install
npm run build
npm start
访问 查看页面

http://localhost:8080/swagger-ui/dist/index.html
默认会引用 http://petstore.swagger.io/v2/swagger.json 这个api,有两种可以修改默认访问的方法:

swagger 服务搭建

原文:http://www.cnblogs.com/skating/p/7865784.html

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