当前位置:网站首页>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
边栏推荐
- use. Net analysis Net talent challenge participation
- 7. Data permission annotation
- Mtcnn face detection
- PHP saves session data to MySQL database
- 2022 refrigeration and air conditioning equipment installation and repair examination contents and new version of refrigeration and air conditioning equipment installation and repair examination quest
- Introduction to the use of SAP Fiori application index tool and SAP Fiori tools
- 15million employees are easy to manage, and the cloud native database gaussdb makes HR office more efficient
- @PathVariable
- OSPF multi zone configuration
- [weekly pit] information encryption + [answer] positive integer factorization prime factor
猜你喜欢

SAP Fiori应用索引大全工具和 SAP Fiori Tools 的使用介绍

使用.Net分析.Net达人挑战赛参与情况

None of the strongest kings in the monitoring industry!

新型数据库、多维表格平台盘点 Notion、FlowUs、Airtable、SeaTable、维格表 Vika、飞书多维表格、黑帕云、织信 Informat、语雀

Infrared thermometer based on STM32 single chip microcomputer (with face detection)

##无yum源安装spug监控

Kubernetes learning summary (20) -- what is the relationship between kubernetes and microservices and containers?
![[DSP] [Part 2] understand c6678 and create project](/img/06/54b1cf1f5b3308fffb4f84dcf7db9b.png)
[DSP] [Part 2] understand c6678 and create project

Quel genre de programmation les enfants apprennent - ils?

Activiti global process monitors activitieventlistener to monitor different types of events, which is very convenient without configuring task monitoring in acitivit
随机推荐
Database - how to get familiar with hundreds of tables of the project -navicat these unique skills, have you got it? (exclusive experience)
Web开发小妙招:巧用ThreadLocal规避层层传值
2022 Guangdong Provincial Safety Officer C certificate third batch (full-time safety production management personnel) simulation examination and Guangdong Provincial Safety Officer C certificate third
2022 refrigeration and air conditioning equipment installation and repair examination contents and new version of refrigeration and air conditioning equipment installation and repair examination quest
Pytest (3) - Test naming rules
Event center parameter transfer, peer component value transfer method, brother component value transfer
1_ Introduction to go language
User defined current limiting annotation
Statistical inference: maximum likelihood estimation, Bayesian estimation and variance deviation decomposition
Summary of different configurations of PHP Xdebug 3 and xdebug2
硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
Web开发小妙招:巧用ThreadLocal规避层层传值
What key progress has been made in deep learning in 2021?
数据湖(八):Iceberg数据存储格式
防火墙基础之外网服务器区部署和双机热备
Rhcsa Road
Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]
PHP saves session data to MySQL database
Implementation of packaging video into MP4 format and storing it in TF Card
Detailed explanation of knowledge map construction process steps