@useoptic/document-sails

0.1.2 • Public • Published

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
  	
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @useoptic/document-sails

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

3.79 kB

Total Files

4

Last publish

Collaborators

  • niclim
  • acunniffe
  • opticbot
  • notnmeyer