Skip to content

Instantly share code, notes, and snippets.

@molekilla
Created August 21, 2014 14:25
Show Gist options
  • Save molekilla/1fd988d89086f6b64944 to your computer and use it in GitHub Desktop.
Save molekilla/1fd988d89086f6b64944 to your computer and use it in GitHub Desktop.
hapi-authenticated-route
var debug = require('debug')('users');
var createHandler = require('./v1/create.js');
exports.register = function(plugin, options, next) {
plugin.route({
method: 'POST',
path: '/v1/users',
handler: createHandler,
config: {
auth: 'token'
}
});
next();
};
exports.register.attributes = {
pkg: require('./package.json')
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment