Skip to content

Instantly share code, notes, and snippets.

@nlf
Last active August 29, 2015 14:06
Show Gist options
  • Save nlf/1df5eac626263ff5b037 to your computer and use it in GitHub Desktop.
Save nlf/1df5eac626263ff5b037 to your computer and use it in GitHub Desktop.
exports.register = function (plugin, options, next) {
plugin.route({
method: 'get',
path: '/',
handler: function (request, reply) {
reply('hello, world');
}
});
next();
};
exports.register.attributes = {
name: 'routes',
version: '1.0.0'
};
var Hapi = require('hapi');
var server = new Hapi.Server();
var routes = require('./routes');
server.pack.register(routes, function (err) {
server.start();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment