Swagger 建立 api文檔
代碼地址:https://github.com/klren0312/stm32_wifi
2017.4.4
第二次增補
1.Swagger
(1)介紹
The World's Most Popular API Framework(世界最流行的API模板)。
(2)工具
- Swagger Editor api文檔編輯
- Swagger Codegen 代碼生成
- Swagger UI 顯示界面
(3)網址
http://swagger.io/
swagger
2.api文檔制作
(1)Swagger Editor編寫
- 1
- 2
- 3
(2)Swagger UI界面
1.在express中定義靜態(tài)文件路由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
訪問即可
QQ截圖20170404161611.png
3.界面測試
QQ截圖20170404161842.png
QQ截圖20170404161852.png
@治電小白菜20170404