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
If you activate the default express.notFound() handler of feathers this handler blocks the request to the remote services. You alway get a 404.
You could just remove the notFound Handler but the problem with that is that you then get a 404 and a html page returned. Since my client only accepts json we had a problem.
Here is my solution:
// Configure a middleware for 404s and the error handlerapp.use((req,res,next)=>{if(app._router.stack.find(r=>r.route&&r.route.path&&r.route.path===req.path)){next();}else{const{ url }=req;constmessage=`Page not found${process.env.NODE_ENV!=='production' ? ': '+url : ''}`;next(newNotFound(message,{ url }));}});app.use(errorHandler);
Hope that helps.
The text was updated successfully, but these errors were encountered:
If you activate the default express.notFound() handler of feathers this handler blocks the request to the remote services. You alway get a 404.
You could just remove the notFound Handler but the problem with that is that you then get a 404 and a html page returned. Since my client only accepts json we had a problem.
Here is my solution:
Hope that helps.
The text was updated successfully, but these errors were encountered: