Skip to content

Commit

Permalink
feat(server): undefined api routes now return a 404
Browse files Browse the repository at this point in the history
  • Loading branch information
DaftMonk committed Feb 15, 2014
1 parent baa973c commit ec829fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions templates/express/routes.js
Expand Up @@ -23,6 +23,11 @@ module.exports = function(app) {
app.post('/api/session', session.login);
app.del('/api/session', session.logout);<% } %>

// All undefined api routes should return a 404
app.get('/api/*', function(req, res) {
res.send(404);
});

// All other routes to use Angular routing in app/scripts/app.js
app.get('/partials/*', index.partials);
app.get('/*',<% if(mongoPassportUser) { %> middleware.setUserCookie,<% } %> index.index);
Expand Down

0 comments on commit ec829fe

Please sign in to comment.