From: Ben Beltran Date: Mon, 14 Sep 2015 02:06:08 +0000 (-0500) Subject: Adds raw route for insults X-Git-Url: https://git.r.bdr.sh/rbdr/generador-de-insultos/commitdiff_plain/4fc8123b78a8b275288fb875254ee1370c0bf59b?ds=sidebyside;hp=ecbfe403e5b260939e84a4f577eba324a7732d4f Adds raw route for insults --- diff --git a/bin/server.js b/bin/server.js index b07aab4..2dbcc1d 100755 --- a/bin/server.js +++ b/bin/server.js @@ -32,6 +32,16 @@ server.route({ } }); +server.route({ + method: 'GET', + path:'/raw', + handler: function (request, reply) { + insults.generate().then(function (insult) { + reply(insult); + }); + } +}); + // Preload stuff, then run console.log("Loading template..."); fs.readFile(path.resolve(__dirname, '../ext/index.html'), {encoding: 'utf8'}, function (err, contents) {