restify-options-builder
v2.2.0
Published
Automatically generates OPTIONS handlers for each register route.
Downloads
4
Readme
restify-options-builder
Automatically generates OPTIONS handlers for each register route.
Usage
var restify = require( 'restify' );
var restifyOptionsBuilder = require( 'restify-options-builder' );
var server = restify.createServer( { name: 'test ' } );
restifyOptionsBuilder( server, function( routing ) {
routing.post( '/random', function create( req, res, next ) {
res.send( 201, Math.random().toString( 36 ).substr( 3, 8 ) );
return next();
} );
} );