You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run any endpoint using the stream feature. For example:
import{Elysia}from'elysia';constapp=newElysia().get('/ok',asyncfunction*(){yield1;yield2;yield3;}).listen(3700);console.log(`🦊 Elysia is running at ${app.server?.hostname}:${app.server?.port}`);export{app};
Currently, Elysia outputs the following:
> curl -N http://localhost:3700/ok
123
What is the expected behavior?
I think we should format automatically format output following the stream format, since it also sets by default the content type as text/event-stream.
Or, at least, we should have a helper function or flag to toggle it.
It's confusing that we aren't wrapping the message as a client probably expects to be.
For example, Insomnia and Postman can't read the event streams sent by Elysia, since it is not wrapped in the expected format.
I know that Eden supports the non-standard stream format outputted by Elysia, but I don't except many clients supporting it.
It's specifically bad if you are developing a public API.
Additional information
I can work on it. But firstly, I would like some guidelines and an agreement in how it should be fixed (e.g., add a flag to toggle it, or something else).
The text was updated successfully, but these errors were encountered:
What version of Elysia is running?
1.1.26
What platform is your computer?
Darwin 24.1.0 arm64 arm
What steps can reproduce the bug?
Run any endpoint using the stream feature. For example:
Currently, Elysia outputs the following:
What is the expected behavior?
I think we should format automatically format output following the stream format, since it also sets by default the content type as
text/event-stream
.Or, at least, we should have a helper function or flag to toggle it.
It's confusing that we aren't wrapping the message as a client probably expects to be.
The expected output is the following:
What do you see instead?
For example, Insomnia and Postman can't read the event streams sent by Elysia, since it is not wrapped in the expected format.
I know that Eden supports the non-standard stream format outputted by Elysia, but I don't except many clients supporting it.
It's specifically bad if you are developing a public API.
Additional information
I can work on it. But firstly, I would like some guidelines and an agreement in how it should be fixed (e.g., add a flag to toggle it, or something else).
The text was updated successfully, but these errors were encountered: