Skip to main content

Command Palette

Search for a command to run...

Nodejs with Swagger

Published
β€’1 min read
Nodejs with Swagger
N

Product Development as an Expertise Since 2015 Founded in August 2015, we are a USA-based Bespoke Engineering Studio providing Product Development as an Expertise. With 80+ satisfied clients worldwide, we serve startups and enterprises across San Francisco, Seattle, New York, London, Pune, Bangalore, Tokyo and other prominent technology hubs.

What is Swagger

Swagger is the largest framework for designing APIs using a common language with including documentation, design, testing, and deployment. Swagger easily comprehensible for both developers and non-developers. Thus, software developers, product and project managers, business analysts, etc can access API design. Also, as Swagger is easily adjustable, it can be successfully used for API testing and bug fixing.

There are 2 packages are used for integrating swagger with APIs in nodejs:

Usage

Install using npm:

npm i swagger-jsdoc swagger-ui-express

after that define routes in the main file called server.js and integrate swagger code for per API.

To check the swagger API documentation

  1. Run the server:

npm run start

2. Open chrome and past server IP address like:

http://localhost:3000/api-docs/

It looks like

Yeah! We successfully integrated Swagger πŸŽ‰

More from this blog

N

NonStop io Technologies

164 posts

Founded in August 2015, we are a USA-based Bespoke Engineering Studio providing Product Development as an Expertise.