When handling a request that does not need a response I would like the default status code to default to 200 (at the moment it is 404).
I have a bunch of api endpoints that insert in to a DB. At the moment I have to set ctx.status OR ctx.body to return a 200 (if left unset then it return a 404). Is there a way to return 200 by default?
Thanks
How do I set the default return status to 200?
1.5k Views Asked by dewijones92 At
1
You can create middleware like that
And include this one before routers