Created
February 11, 2018 21:20
-
-
Save antony/11b028fc1ff39f63be64824f9642eac8 to your computer and use it in GitHub Desktop.
Seed hapijs v17 application.
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' | |
const Hapi = require('hapi') | |
const server = Hapi.server({ port: 3000, host: 'localhost' }) | |
const init = async () => { | |
await server.start() | |
console.log(`Server running at: ${server.info.uri}`) | |
} | |
init().catch((err) => { | |
console.log(err) | |
process.exit(1) | |
}) | |
server.route({ | |
method: 'GET', | |
path: '/{name}', | |
handler: (request, h) => { | |
return 'Hello, world!' | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment