Replies: 1 comment
-
what about this? |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Goals
Non-Goals
No response
Background
From what I found at the moment of time being it's not possible to easily share data between custom server (like expressjs) and nextjs. I have a custom express server nextjs app (app router 14.x) where my session is handled on the express side which has access to the user session from req/res object and in order to share that session I need a hacky solution with AsyncLocalStorage to access that user session data in nextjs land (api, rsc, etc.)
I've seen a lot of folks having custom server and the same problem and doing hacky solutions to solve it... So It seems a valid proposal
Proposal
Add a
context
to thegetRequestHandler
which will be available in the nextjs api routes, middleware etc to easily share and access data from the custom server.Heres how Remix handles that you can create the context which is available across remix API
Beta Was this translation helpful? Give feedback.
All reactions