diff --git a/friday-participants.json b/friday-participants.json index 4b80c8f..bfbe89f 100644 --- a/friday-participants.json +++ b/friday-participants.json @@ -27,5 +27,6 @@ "davidfoliveira", "pmarques", "gergelyke", - "anarcastanho" + "anarcastanho", + "nelsonic" ] \ No newline at end of file diff --git a/lib/plugins/nelsonic/index.js b/lib/plugins/nelsonic/index.js index 26e7604..cdbb8a4 100644 --- a/lib/plugins/nelsonic/index.js +++ b/lib/plugins/nelsonic/index.js @@ -6,6 +6,11 @@ var internals = {}; // Defaults internals.defaults = {}; +var mapper = function (request, callback) { + callback(null, 'http://www.google.com/search?q='+request.params.name); +}; + + exports.register = function(plugin, options, next) { plugin.route({ @@ -16,10 +21,21 @@ exports.register = function(plugin, options, next) { } }); + // plugin.route({ + // method: 'GET', + // path: '/nelsonic-proxy/{name}', + // handler: function(request, reply) { + // reply.proxy({ + // redirects:2, + // mapUri: mapper + // }); + // } + // }); + next(); }; exports.register.attributes = { name: 'nelsonic', - version: '0.0.0' + version: '0.0.1' }; diff --git a/server.js b/server.js index 8afaab5..1f4d0d2 100644 --- a/server.js +++ b/server.js @@ -1,11 +1,11 @@ var Hapi = require('hapi'); var FridayParticipants = require('./friday-participants.json'); +// console.log(FridayParticipants); var server = Hapi.createServer('0.0.0.0', 8080); - FridayParticipants.forEach(function (participant) { - + // console.log("P:",participant); var participantPlugin = require('./lib/plugins/' + participant); server.pack.register(participantPlugin, function (err) {