Skip to content

Instantly share code, notes, and snippets.

@jstrimpel
Created July 11, 2015 20:22
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 jstrimpel/3b2770558b2b397f616f to your computer and use it in GitHub Desktop.
Save jstrimpel/3b2770558b2b397f616f to your computer and use it in GitHub Desktop.
hapi hello world
var Hapi = require('hapi');
// Create a server with a host and port
var server = new Hapi.Server();
server.connection({
host: 'localhost',
port: 8000
});
// Add the route
server.route({
method: 'GET',
path:'/hello',
handler: function (request, reply) {
reply('hello world');
}
});
// Start the server
server.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment