Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

jsrubio/restify-swagger-jsdoc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

restify-swagger-jsdoc

Create Swagger documentation page based on jsdoc

npm Version npm Downloads Dependency Status

Installation

npm install restify-swagger-jsdoc

Initialization

To initialize the swagger JSDoc page, simply add this lines to the file that loads your restify server :

var restifySwaggerJsdoc = require('restify-swagger-jsdoc');
restifySwaggerJsdoc.createSwaggerPage({
    title: 'API documentation', // Page title (required)
    version: '1.0.0', // Server version (required)
    server: server, // Restify server instance created with restify.createServer()
    path: '/docs/swagger', // Public url where the swagger page will be available
    apis: [ `${__dirname}/controllers/*.js` ], // Path to the API docs
    routePrefix: 'prefix' // prefix to add for all routes (optional)
});

With these settings, assuming that your server listens on port 80, the Swagger documentation page will be available at http://localhost/docs/swagger. The swagger.json file is available at http://localhost/docs/swagger/swagger.json.

How to document the API

This module is based on swagger-jsdoc, so you can refer to this module's documentation to document your API.

About

Create Swagger documentation page based on jsdoc

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%