Skip to content

Commit ec829fe

Browse files
committed
feat(server): undefined api routes now return a 404
1 parent baa973c commit ec829fe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: templates/express/routes.js

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ module.exports = function(app) {
2323
app.post('/api/session', session.login);
2424
app.del('/api/session', session.logout);<% } %>
2525

26+
// All undefined api routes should return a 404
27+
app.get('/api/*', function(req, res) {
28+
res.send(404);
29+
});
30+
2631
// All other routes to use Angular routing in app/scripts/app.js
2732
app.get('/partials/*', index.partials);
2833
app.get('/*',<% if(mongoPassportUser) { %> middleware.setUserCookie,<% } %> index.index);

0 commit comments

Comments
 (0)