2 * Main application routes
7 var errors = require('./components/errors');
8 var path = require('path');
10 module.exports = function(app) {
12 // Insert routes below
13 app.use('/api/comments', require('./api/comment'));
14 app.use('/api/categories', require('./api/category'));
15 app.use('/api/shows', require('./api/show'));
16 app.use('/api/test', require('./api/message'));
17 app.use('/api/users', require('./api/user'));
19 app.use('/auth', require('./auth'));
21 // All undefined asset or api routes should return a 404
22 app.route('/:url(api|auth|components|app|bower_components|assets)/*')
25 // All other routes should redirect to the index.html
27 .get(function(req, res) {
28 res.sendFile(path.resolve(app.get('appPath') + '/index.html'));