Swagger 建立 api文档 代码地址:github.com/klren0312/s… 2017.4.4
第二次增补
1.Swagger
(1)介绍 The World's Most Popular API Framework(世界最流行的API模板)。
(2)工具
- Swagger Editor api文档编辑
- Swagger Codegen 代码生成
- Swagger UI 显示界面
(3)网址 swagger.io/
2.api文档制作
(1)Swagger Editor编写
(2)Swagger UI界面
1.在express中定义静态文件路由app.use('/static',express.static('public'));
2.将Swagger UI 代码clone到本地 git clone https://github.com/swagger-api/swagger-ui.git
3.在express项目文件夹中,新建一个叫public文件夹,将clone后的代码中的dist文件下所有文件复制到public文件夹。
4.http://localhost:3000/static/index.html访问即可
3.界面测试
@治电小白菜20170404