A few things I learned from Koa (from which Oak is inspired):
You don't need to set the status of the response to 200, if you set its body to something
You don't need to send a 404, just return without touching response.body
You can set a middleware to handle error http codes, if you want to send a JSON payload along with the status, without specifying the error payload in each of your routes:
A few things I learned from Koa (from which Oak is inspired):
response.body
You can set a middleware to handle error http codes, if you want to send a JSON payload along with the status, without specifying the error payload in each of your routes:
All that should simplify the code of your router handlers a fair bit :)