0.1.2 • Published 6 years ago

@useoptic/document-sails v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

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

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago