Created
January 19, 2017 17:16
-
-
Save cbergau/bf862d9ae95659acd702cd890439659f 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
const Hapi = require('hapi'); | |
const server = new Hapi.Server(); | |
server.connection({ | |
port: 3000, | |
host: 'localhost' | |
}); | |
server.route({ | |
method: 'GET', | |
path: '/greet', | |
handler: ( (request, reply) => { | |
reply('Hello!'); | |
}) | |
}); | |
server.start((err) => { | |
if (err) { | |
throw err; | |
} | |
console.log(`Server running at: ${server.info.uri}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment