Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Give full control of express response object for user #1246

Open
kingdun3284 opened this issue Jan 2, 2024 · 0 comments
Open

Comments

@kingdun3284
Copy link
Member

kingdun3284 commented Jan 2, 2024

Although it is possible to add premiddleware to intercept the request before it is processed by foal's core.
It is better to simply pass the raw express response object to Context as well.
So developers can interact with the raw response object in advanced use case while hooks for checking incoming request can still be reusable when implementing features like SSE(server-sent event) or streaming.
A simple check of the response type in sendResponse function to determine whether or not to execute the default behaviours would be fine.

@LoicPoullain What do you think? I can submit a PR for this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant