Skip to content

Commit

Permalink
PR pending response to issue: hapijs/hapi#2715
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Aug 15, 2015
1 parent bf1f24c commit e4ad2cc
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions examples/helloparam.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,22 @@
node helloparam.js
then visit: http://localhost:3000/YOURNAME
*/
var Hapi = require('hapi');

var Hapi = require('hapi');
var server = new Hapi.Server();

server.connection({
host: '0.0.0.0',
port: 3000
});


server.route({
method: 'GET',
path: '/{p*}',
handler: function(req, reply){
reply('Hello ' + req.params.p)
server.log(["test"], "This is my log entry!");
return reply('Hello ' + req.params.p)
}
})

server.start(function(){
console.log('Now Visit: http://localhost:3000/YOURNAME')
});

server.on("log", function(event, tags) {
var tagsJoined = Object.keys(tags).join();
var message = event.data;
console.log("Log entry [" + tagsJoined + "] (" + (message || "") + ")");
});

0 comments on commit e4ad2cc

Please sign in to comment.