]> git.r.bdr.sh - rbdr/generador-de-insultos/commitdiff
Adds raw route for insults
authorBen Beltran <redacted>
Mon, 14 Sep 2015 02:06:08 +0000 (21:06 -0500)
committerBen Beltran <redacted>
Mon, 14 Sep 2015 02:06:08 +0000 (21:06 -0500)
bin/server.js

index b07aab4285c87607a6c07777c47db194ad865f01..2dbcc1d1d4ae9c16165613cbb584f602fc4432fa 100755 (executable)
@@ -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) {