Add 404 and 500 routes

This commit is contained in:
perryharlock
2013-09-24 15:24:54 +01:00
parent d477f66146
commit eb7f7205f9
2 changed files with 14 additions and 7 deletions

7
app.js
View File

@@ -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) {

View File

@@ -74,15 +74,16 @@
</div>
</div>
<!-- ########### Functionality to be done ############## -->
<div class="row">
<div class="action-buttons clearfix">
<div class="col-md-12 col-xs-6">
<button class="btn-full-width btn btn-default">Download CSV <span class="glyphicon glyphicon-download"></span></button>
<a class="btn-full-width btn btn-default">Download CSV <span class="glyphicon glyphicon-download"></span></a>
</div>
<!-- ########### Functionality to be done ############## -->
<div class="col-md-12 col-xs-6">
<button class="btn-full-width btn btn-default">Download JSON <span class="glyphicon glyphicon-download"></span></button>
<a href="/{{task.id}}.json" target="_blank" class="btn-full-width btn btn-default">Download JSON <span class="glyphicon glyphicon-download"></span></a>
</div>
<!-- ##################### End ######################## -->
</div>
</div>
{{/if}}
@@ -92,11 +93,12 @@
<h4 class="crunch-top ruled-sm">Your other tracked URLs</h4>
<p>No other urls</p>
<!-- ########### Functionality to be done ############## -->
<!-- <ul class="list-unstyled crunch-bottom">
<!-- ########### Functionality to be done ############# -->
<ul class="list-unstyled crunch-bottom">
<li><a href="empty-task">rowanmanning.com</a></li>
<li><a href="task">nature.com</a></li>
</ul> -->
</ul>
<!-- ##################### End ######################## -->
</div>
</div>