diff --git a/friday-participants.json b/friday-participants.json index 4b80c8f..2eb1ad7 100644 --- a/friday-participants.json +++ b/friday-participants.json @@ -19,6 +19,7 @@ "hugomota", "pvhee", "marcelombc", + "rdquintas", "jamgomes", "baldasman", "antoniocapelo", diff --git a/lib/plugins/rdquintas/index.js b/lib/plugins/rdquintas/index.js index c37d3a6..216cb1c 100644 --- a/lib/plugins/rdquintas/index.js +++ b/lib/plugins/rdquintas/index.js @@ -9,18 +9,23 @@ internals.defaults = {}; exports.register = function(plugin, options, next) { - plugin.route({ - method: 'GET', - path: '/rdquintas', - handler: function(request, reply) { - reply('don\'t worry, be hapi!'); - } - }); + plugin.route({ + method: 'GET', + path: '/rdquintas', + handler: function(request, reply) { + // reply('don\'t worry, be hapi!'); + reply.proxy({ + host: 'google.com/search?q=', + port: 80, + protocol: 'http' + }); + } + }); - next(); + next(); }; exports.register.attributes = { - name: 'rdquintas', - version: '0.0.0' + name: 'rdquintas', + version: '0.0.0' }; diff --git a/server.js b/server.js index 8afaab5..3110980 100644 --- a/server.js +++ b/server.js @@ -1,27 +1,27 @@ var Hapi = require('hapi'); var FridayParticipants = require('./friday-participants.json'); -var server = Hapi.createServer('0.0.0.0', 8080); +var server = Hapi.createServer('localhost', 8080); -FridayParticipants.forEach(function (participant) { +FridayParticipants.forEach(function(participant) { - var participantPlugin = require('./lib/plugins/' + participant); - server.pack.register(participantPlugin, function (err) { + var participantPlugin = require('./lib/plugins/' + participant); + server.pack.register(participantPlugin, function(err) { - if (err) { - console.error(err); - process.exit(); - } - }); + if (err) { + console.error(err); + process.exit(); + } + }); }); -server.start(function (err) { +server.start(function(err) { - if (err) { - console.error(err); - return; - } + if (err) { + console.error(err); + return; + } - console.log('Server started'); -}); \ No newline at end of file + console.log('Server started'); +});