Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.