Skip to content

Commit

Permalink
Lint examples/server.js
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbayerlein committed Nov 6, 2016
1 parent d8136a1 commit a94afe6
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions examples/server.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
'use strict';

const Hapi = require('hapi');
const hapijsStatusMonitor = require('hapijs-status-monitor');

// Create a server with a host and port
const server = new Hapi.Server();
server.connection({
host: 'localhost',
port: 8000
port: 8000,
});

server.register({
register: require('hapijs-status-monitor')
});
server.register({ register: hapijsStatusMonitor });

// Add the "/return-status/{statusCode}" route
server.route({
method: 'GET',
path: '/return-status/{statusCode}',
handler: function (request, reply) {
handler: function handler(request, reply) {
const statusCode = request.params.statusCode;

return reply(statusCode).code(parseInt(statusCode));
}
return reply(statusCode).code(parseInt(statusCode, 10));
},
});

// Start the server
server.start((err) => {
if (err) throw err;
console.log('Server running at:', server.info.uri);
console.log('Server running at:', server.info.uri); // eslint-disable-line no-console
});

0 comments on commit a94afe6

Please sign in to comment.