Documentation - Write-IN/Write-In Wiki
The documentation tool that will be used for the project Write-In is - “swagger-jsdoc “. This library reads JSDoc-annotated source code and generates a documentation specification.
For using it, first install it as npm package using command
npm install swagger-jsdoc
Node.js 12.x or higher versions
How to use
First install it to the project using the installation procedure described before.
Then include the package to the file which is needed to be documented like this.
const swaggerJsdoc = require('swagger-jsdoc');
Then comment following JSDoc annotation.
Swagger will automatically generate documentation which will be an html file.
For the file you can visit: http://localhost:<<port_no>>/api-docs/
Comment following JSDoc annotation in your desired file:
For above source code generated documentation will be:
To know more about JSDoc annotation visit: JSDoc