Middleware layer implemented in entry.server.tsx
#3578
Closed
takumi-miyajima
started this conversation in
Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There are several arguments for the middleware layer.
ref: #1432
Why don't we work together to come up with a good implementation?
For example, I think it would be simple and powerful if we could export the following function to
entry.server.tsx
If you have a better implementation or a better name, we would be glad to have you join the discussion.
Known implementations:
handleDataRequest
Can only be used for json responses.
Not called for document or resource requests.
Also, only post-processing of responses is supported.
beforeRequest
|beforeResponse
wip: proof of concept for request / response hooks #364
If implemented on the @remix-run/{adapter} side, it cannot support an environment like vercel.
Loaders or actions dynamically generated on each route
Server code will be contained in Client side.
This is undesirable in most cases.
ref
Please let us know your thoughts.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions