Skip to content

Instantly share code, notes, and snippets.

@cbergau
Created January 19, 2017 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbergau/bf862d9ae95659acd702cd890439659f to your computer and use it in GitHub Desktop.
Save cbergau/bf862d9ae95659acd702cd890439659f to your computer and use it in GitHub Desktop.
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