Skip to content

Any idea to default/enforce JSON responses? #2935

Answered by EdamAme-x
MaximeBernard asked this question in Q&A
Discussion options

You must be logged in to vote

hmm...
I think that is possible.
But, we have some breaking problems.
That way of writing is similar to elysia.js.
In Hono, that kind of return is impossible due to types.
Perhaps you can do it by playing with the response in middleware, but I don't recommend it because of the types issue.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@MaximeBernard
Comment options

@EdamAme-x
Comment options

@EdamAme-x
Comment options

Answer selected by MaximeBernard
@MaximeBernard
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants