Skip to content

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

Description

@kingdun3284

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions