An express application with swagger, swagger-jsdoc, express-swagger-ui and redoc.
expressjsCRUD application.swagger-jsdocto write the specsexpress-swagger-uito show the Swagger interface.redocfor mobile friendly API documentation.- Use RapidAPI for documenation, testing, discovery and integration of API
> npm init
> npm i express [email protected] morgan nanoid cors [email protected] swagger-ui-express redoc-expressTo see the swagger documentation go to http://localhost:4000/api/v1/api-docs/.
> git clone https://github.com/murshidazher/express-swagger-api.git
> cd express-swagger-api
> npm install
> npm start- We need to create a multi-line comment with
@swagger. - In
componentssection we define the schema which could be re-used with therefkeyword. - We define
tagsto group our requests, without them appearing in thedefaultgroup.
List of Endpoints of /api/v1/,
| Endpoints | Description |
|---|---|
/api-docs |
Interactive SwaggerUI |
/docs |
Redoc mobile friendly documentation |
/docs/swagger.json |
Download OpenAPI3 Specification in JSON |
- Example pet-api OpenAPI specification.
MIT © 2021 Murshid Azher.