Created
April 26, 2016 19:44
-
-
Save andrunix/63fca6dbedfc2eb7686bef011edf3178 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
html | |
body | |
h1= hello world | |
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
'use strict'; | |
const Hapi = require('hapi'); | |
const Vision = require('vision'); | |
const internals = {}; | |
const rootHandler = function(request, reply) { | |
reply.view('index', { | |
title: 'Andrew Title', | |
message: 'Hello bitches' | |
}); | |
}; | |
internals.main = function() { | |
const server = new Hapi.Server(); | |
server.connection({ port: 8000 }); | |
debugger; | |
server.register(Vision, (err) => { | |
debugger; | |
if (err) throw err; | |
server.views({ | |
engines: { jade: require('jade') }, | |
path: __dirname + '/templates', | |
compileOptions: { | |
pretty: true | |
} | |
}); | |
server.route({ method: 'GET', path: '/', handler: rootHandler }); | |
debugger; | |
server.start((err) => { | |
if (err) throw err; | |
console.log('Server is listening at ' + server.info.uri); | |
}); | |
}); | |
}; | |
internals.main(); | |
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
{ | |
"name": "jade-test", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"boom": "^3.1.2", | |
"hoek": "^4.0.0", | |
"items": "^2.0.0", | |
"vision": "^4.1.0" | |
}, | |
"devDependencies": { | |
"babel-core": "^6.7.7", | |
"hapi": "^13.3.0", | |
"jade": "^1.11.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment