ar-io / arns-service

Koa microservice that leverages Warp to support the ArNS Portal and ar.io observers.
https://api.arns.app
GNU Affero General Public License v3.0
19 stars 4 forks source link

chore(refactor): remove `return next()` from router handlers #57

Closed dtfiedler closed 9 months ago

dtfiedler commented 9 months ago

In koa, the use of next() allows for async middleware. It is not necessary, and actually creates unexpected behavior to use return next() within route handlers as it passes control flow to the next route that matches the request path, rather then returning the response. Going forward, next() is likely only needed in middlware, unless we have some special path chaining we are trying to do.