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
cainus edited this page Apr 14, 2012
·
6 revisions
Detour handles some http status code responses itself, by simply returning the status code with an empty body. You can over-ride this behaviour in instances of it simply by monkey-patching:
vardetour=require('detour').detour;varrouter=newdetour('/api',{});router.handle404=function(req,res){res.send(404,"this is a custom 404 error")}
Methods that are supported (and can be overridden) are: