2015-02-06 16:46:55 +01:00
|
|
|
/**
|
|
|
|
* Main application routes
|
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var errors = require('./components/errors');
|
|
|
|
|
|
|
|
module.exports = function(app) {
|
|
|
|
|
|
|
|
// Insert routes below
|
2015-04-12 08:42:47 +02:00
|
|
|
|
|
|
|
app.use('/api/compare', require('./api/comparison'));
|
|
|
|
|
2015-02-06 16:46:55 +01:00
|
|
|
// All undefined asset or api routes should return a 404
|
2015-04-18 01:17:19 +02:00
|
|
|
app.route('/:url(api|components|app|bower_components|assets)/*')
|
2015-02-06 16:46:55 +01:00
|
|
|
.get(errors[404]);
|
|
|
|
|
|
|
|
// All other routes should redirect to the index.html
|
|
|
|
app.route('/*')
|
|
|
|
.get(function(req, res) {
|
|
|
|
res.sendfile(app.get('appPath') + '/index.html');
|
|
|
|
});
|
|
|
|
};
|