Skip to content

Instantly share code, notes, and snippets.

@ekristen
Last active December 1, 2018 08:12
Show Gist options
  • Save ekristen/9562179 to your computer and use it in GitHub Desktop.
Save ekristen/9562179 to your computer and use it in GitHub Desktop.
Example Integration of Restify Endpoints
var restify = require('restify');
var restify_endpoints = require('restify-endpoints');
var endpoints = new restify_endpoints.EndpointManager({
endpointpath: __dirname + '/endpoints'
});
// Create the RESTful Server
var server = restify.createServer();
server.use(restify.acceptParser(server.acceptable));
server.use(restify.authorizationParser());
server.use(restify.dateParser());
server.use(restify.queryParser());
server.use(restify.jsonp());
server.use(restify.gzipResponse());
server.use(restify.bodyParser());
server.use(restify.conditionalRequest());
// Attach Restify Endpoints to RESTify server
endpoints.attach(server);
server.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment