You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to configure my API with routing controllers in an Express project, but I'm having difficulty handling routes without issues (404) and general errors.
The problem is that the error handler must be the last defined middleware in express. Since you add an additional middleware at the end for 404, it will not trigger the error handler.
A workaround would be to define the error handler outside of routing-controllers either for all errors or just the 404.
I'm trying to configure my API with routing controllers in an Express project, but I'm having difficulty handling routes without issues (404) and general errors.
And the
The problem:
When I access a non-existent route (ex: /userss), I receive: Cannot set headers after they are sent to the client
The text was updated successfully, but these errors were encountered: