Skip to content

Commit

Permalink
Updated the example with Hapi (v17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-LyN-10 committed Oct 8, 2018
1 parent 7bda7b5 commit 4cf03a3
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,25 +90,34 @@ app.listen(3000, () => {
const Hapi = require('hapi');
const epimetheus = require('epimetheus');
const server = new Hapi.Server();
const server = Hapi.Server({
port: 8002
})
server.connection({
port: 3000
});
async function init() {
try {
await epithemeus.instrument(server);
epimetheus.instrument(this.server);
server.route({
method: 'GET',
path: '/',
handler: async (request, h) => {
return h.response()
}
})
await server.start()
console.log(`Hapi ${server.version} server listening on port 8002`)
server.route({
method: 'GET',
path: '/',
handler: (req, resp) => {
resp();
} catch(err) {
console.log('Error', err);
process.exit(1);
}
});
server.start(() => {
console.log('hapi server listening on port 3000');
});
}
init();
```
# <a name="restify"></a> Restify
```
Expand Down

0 comments on commit 4cf03a3

Please sign in to comment.