This repository has been archived by the owner on Oct 18, 2022. It is now read-only.
Implement direct data return from controller classes #12
Labels
discovery
more information is needed
feature
New feature or request
package/core
issues related to @kangojs/core
Package Information:
core
@*
Describe your feature
RIght now the controller methods that KangoJS binds to routes have no special handling which means you still have boilerplate code with sending responses and forwarding errors to
next()
:It would be great if the framework could absorb some of that repeated handling, so you could just do something like this instead and the returned data is sent in a response automatically and thrown errors are caught are handled:
Users should be able to still send a response manaully themselves though.
This will require a bit of discover work:
return await
?)Is your suggestion related to any problems?
Controllers have a lot of repeated boilerplate code around response & error handling.
Additional context
n/a
The text was updated successfully, but these errors were encountered: