From 8423684deeec540900fe5aacc3d04d7f9a7c4b55 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Sun, 4 Aug 2013 14:08:05 -0400 Subject: [PATCH] closes #145, fixed 404 not rendering --- src/routes/api.js | 4 ++++ src/webserver.js | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/routes/api.js b/src/routes/api.js index 9629869bc4..bb64ce1ba7 100644 --- a/src/routes/api.js +++ b/src/routes/api.js @@ -177,5 +177,9 @@ var user = require('./../user.js'), }); }); + + app.get('/api/404', function(req, res) { + res.json({}); + }); } }(exports)); diff --git a/src/webserver.js b/src/webserver.js index 41a5b0e8f7..b27ce2868b 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -319,7 +319,7 @@ var express = require('express'), }); app.get('/confirm/:code', function(req, res) { - app.build_header({ req: req, res: res }, function(header) { + app.build_header({ req: req, res: res }, function(err, header) { res.send(header + '' + templates['footer']); }); }); @@ -371,7 +371,7 @@ var express = require('express'), var url = req.url.split('?'); if (url[1]) { - app.build_header({ req: req, res: res }, function(header) { + app.build_header({ req: req, res: res }, function(err, header) { res.send(header + templates['outgoing'].parse({ url: url[1], home: global.nconf.get('url')