当前位置:网站首页>Swagger UI tutorial API document artifact
Swagger UI tutorial API document artifact
2022-07-06 20:56:00 【51CTO】
Catalog
[TOC]
Preface
In some interface projects ,API Is used frequently , So a API Online document generation and testing tools are essential . and Swagger UI It's such a practical online tool
This blog describes how to follow the Swagger UI, Note that the company's test server is Linux Systematic , Therefore, this blog only introduces based on Linux Systematic Swagger Environment building process
Server environment installation ##
NodeJS Download deployment ###
First you need to download NodeJS, To nodejs Official website http://nodejs.org/dist/v0.10.26, download node-v0.10.26-linux-x64.tar.gz, Because this is already compiled , So we first use software to upload files to Linux The server , have access to WinSCP
And then use Linux Of cd The command comes to you nodejs Location of compressed files
The decompression command is as follows :
And then go to the file
perform
Set up node overall situation
Set up npm overall situation
testing nodejs and npm Is the installation successful
You can see the version number , What installation succeeded
express Download deployment ####
Install well NodeJS and NPM after , We can install it express 了
The following important modules are needed with express The frame is installed together :
body-parser - node.js middleware , Used for processing JSON, Raw, Text and URL Encoded data .
cookie-parser - This is an analysis Cookie Tools for . adopt req.cookies You can take it from cookie, And turn them into objects .
multer - node.js middleware , Used for processing enctype="multipart/form-data"( Set the MIME code ) Form data for .
Check whether the installation is successful
NodeJS Boot up ####
Then set the NodeJS Boot up
install forever
Set up
Swagger UI Installation and deployment ##
github On clone: https://github.com/swagger-api/swagger-ui If there is a download Git, Just use git download , Get access to github, Direct download
Then, according to the needs of the company , stay Linux On mkdir, I was there first root route , Create a node_app file
Get into node_app
Environment configuration
The following tips can be filled in according to your own needs
VI Editor use :
Add code
Enable server
visit , Input http:// Company servers IP:3000
You can see Helloworld, Of course, we need to deploy Swagger
stay node_app So let's create one public Folder
Then download to swagger ui Inside dist Copy the files in the folder to public Folder
modify index.js
Then input http://ip:3000/swapper, Yes, you can see something similar page
Picture description here
Swagger Editor Use ##
Swagger Editor yes Swagger UI The online editor , We can build our own , You can also use the official , The official URL: http://editor.swagger.io/#/
github On Clone: https://github.com/swagger-api/swagger-editor After the swagger editor Put the document in the company Linux Server
Http server install ###
Start the project http-server swagger-editor, The default is 8080 port
Set up port And start the swagger editor
Input http://ip:2017/#/ You can access your own Swagger Editor Editor
Reference tutorial
http://www.linuxidc.com/Linux/2014-07/104489.htm
http://www.linuxidc.com/Linux/2014-06/103372.htm
边栏推荐
- SAP UI5 框架的 manifest.json
- OSPF多区域配置
- 小孩子學什麼編程?
- Pat 1085 perfect sequence (25 points) perfect sequence
- [weekly pit] positive integer factorization prime factor + [solution] calculate the sum of prime numbers within 100
- 强化学习-学习笔记5 | AlphaGo
- Rhcsa Road
- R語言可視化兩個以上的分類(類別)變量之間的關系、使用vcd包中的Mosaic函數創建馬賽克圖( Mosaic plots)、分別可視化兩個、三個、四個分類變量的關系的馬賽克圖
- 1500萬員工輕松管理,雲原生數據庫GaussDB讓HR辦公更高效
- Taylor series fast Fourier transform (FFT)
猜你喜欢
审稿人dis整个研究方向已经不仅仅是在审我的稿子了怎么办?
[DSP] [Part 2] understand c6678 and create project
Entity alignment two of knowledge map
None of the strongest kings in the monitoring industry!
C language operators
看过很多教程,却依然写不好一个程序,怎么破?
I've seen many tutorials, but I still can't write a program well. How can I break it?
Trends of "software" in robotics Engineering
What programming do children learn?
【mysql】触发器
随机推荐
Redis insert data garbled solution
Design your security architecture OKR
Activiti global process monitors activitieventlistener to monitor different types of events, which is very convenient without configuring task monitoring in acitivit
1500萬員工輕松管理,雲原生數據庫GaussDB讓HR辦公更高效
Pat 1078 hashing (25 points) ⼆ times ⽅ exploration method
“罚点球”小游戏
快过年了,心也懒了
OLED屏幕的使用
Entity alignment two of knowledge map
审稿人dis整个研究方向已经不仅仅是在审我的稿子了怎么办?
15 millions d'employés sont faciles à gérer et la base de données native du cloud gaussdb rend le Bureau des RH plus efficace
Build your own application based on Google's open source tensorflow object detection API video object recognition system (IV)
Utilisation de l'écran OLED
How to upgrade high value-added links in the textile and clothing industry? APS to help
Rhcsa Road
[weekly pit] output triangle
PG basics -- Logical Structure Management (transaction)
Dynamically switch data sources
Review questions of anatomy and physiology · VIII blood system
【OpenCV 例程200篇】220.对图像进行马赛克处理