Last active
August 29, 2015 14:03
-
-
Save nlf/d3076d0cf178112ee2e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.index = function (request, reply) { | |
reply('hello world'); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Methods = require('./methods'); | |
exports.register = function (plugin, options, next) { | |
plugin.route({ | |
method: 'GET', | |
path: '/', | |
handler: Methods.index | |
}) | |
next(); | |
}; | |
exports.register.attributes = { | |
name: 'routes' | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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