Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

restify-swagger-jsdoc

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restify-swagger-jsdoc

Create Swagger documentation page based on jsdoc

  • 1.0.9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
567
decreased by-13.17%
Maintainers
1
Weekly downloads
 
Created
Source

restify-swagger-jsdoc

Create Swagger documentation page based on jsdoc

Build Status Coverage Status npm Version npm Downloads Dependency Status

Installation

npm install restify-swagger-jsdoc --production

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
    definitions: {myObject: require('api/myObject.json')}, // External definitions to add to swagger (optional)
    routePrefix: 'prefix', // prefix to add for all routes (optional)
    forceSecure: false // force swagger-ui to use https protocol to load JSON file (optional, default: false)
});

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.

Keywords

FAQs

Package last updated on 30 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc