Skip to content

Instantly share code, notes, and snippets.

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