Last active
May 8, 2017 19:56
-
-
Save AdriVanHoudt/616f7fdcd4c9334e742c6fd8b705dfd1 to your computer and use it in GitHub Desktop.
Glimpse + hapi = not a hapi server
This file contains hidden or 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'; | |
if (process.env.NODE_ENV !== 'production') { | |
require('@glimpse/glimpse').init(); | |
} | |
const Hapi = require('hapi'); | |
const server = new Hapi.Server(); | |
server.connection(); | |
server.route({ | |
method: 'GET', | |
path: '/world', | |
handler: (request, reply) => { | |
return reply('Hello world'); | |
} | |
}); | |
server.start((err) => { | |
if (err) { | |
throw err; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment