makemehapi
Version:
Self guided workshops to teach you about hapi.
30 lines (23 loc) • 508 B
JavaScript
var Hapi = require('hapi');
var Vision = require('vision');
var Path = require('path');
var server = new Hapi.Server();
server.connection({
host: 'localhost',
port: Number(process.argv[2] || 8080)
});
server.register(Vision, function () {});
server.views({
engines: {
html: require('handlebars')
},
path: Path.join(__dirname, 'templates')
});
server.route({
method: 'GET',
path: '/',
handler: {
view: 'index.html'
}
});
server.start(function () {});