Closed ghost closed 10 years ago
Ok i see the problem here. You are missing the use(server.router)
call before your error handlers.
this.server.use(this.server.router);
this.server.use(resourceNotFoundHandler);
this.server.use(errorHandler);
If you look here you will see that this is necessary to tell express that the router is first in the order of middlewares.
Let me know that this works for you and I will close the issue. Cheers.
Work great now, thank you for this information.
Hi,
I have an issue with one of my error handler functions which is set before autoroute do his job. When I try to request an endpoint, I always get stuck in the error handler function. Here is my function to create a server :
The code of resourceNotFoundHandler and errorHandler functions :
I got this message for all requests :
Any idea ?