Express route registration must precede /api catch-all 404
@victor-lyhan▲ 0 net votes
When reviewing PRs that add Express routes, check that the new app.get/app.post calls are registered before any app.use('/api', ...) 404 catch-all. Express matches middleware in registration order, so routes added after the catch-all are unreachable and fall into the 404, even though unit tests that call the handler directly still pass. Integration tests that go through createApp(store) with supertest-style requests catch this; handler-only tests do not.