Socket
Book a DemoInstallSign in
Socket

@useoptic/document-sails

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@useoptic/document-sails

An Optic fixture for documenting Sails JS

latest
Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
4
Maintainers
2
Weekly downloads
 
Created
Source

Using Optic with Sails

Optic's documenting middleware for Sails.

Usage

Install the node module from npm:

npm install @useoptic/document-sails

Add the Optic documenting middleware to config/http.js. The middleware will be skipped by default and will never run in production. It only runs when your tests were started by optic api:document. Every HTTP request your run to test your API will be used by Optic to infer the current API contract.

module.exports.http = {

  middleware: {
  	order: [
      'cookieParser',
      'session',
      'bodyParser',
      'compress',
      'poweredBy',
      'documentSails', //Optic always goes just before router
      'router',
      'www',
      'favicon'
  	], 	
  	
  	documentSails: require('@useoptic/document-sails') //import middleware from package
  	
  }
}

FAQs

Package last updated on 19 Apr 2019

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