From eb7f7205f92318acd40d2c1b22fa2c8e42773c81 Mon Sep 17 00:00:00 2001 From: perryharlock Date: Tue, 24 Sep 2013 15:24:54 +0100 Subject: [PATCH] Add 404 and 500 routes --- app.js | 7 ++++++- view/task.html | 14 ++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app.js b/app.js index b56729e..5fe9896 100644 --- a/app.js +++ b/app.js @@ -56,10 +56,15 @@ function initApp (config, callback) { require('./route/task')(app); // Error handling + app.express.get('*', function (req, res) { + res.status(404); + res.render('404'); + }); app.express.use(function (err, req, res, next) { /* jshint unused: false */ app.emit('route-error', err); - res.send('Error'); + res.status(500); + res.render('500'); }); app.server.listen(config.port, function (err) { diff --git a/view/task.html b/view/task.html index 0924366..c96b150 100644 --- a/view/task.html +++ b/view/task.html @@ -74,15 +74,16 @@ -
- + Download CSV
+
- + Download JSON
+
{{/if}} @@ -92,11 +93,12 @@

Your other tracked URLs

No other urls

- - + --> + +