T
TanStack7d ago
provincial-silver

How do I read session data outside of the asynclocalstorage context?

Is there some function I can pass a request into and get the session data out? I need to get an API token from the session to use in a proxy middleware in my express server running the whole app.
3 Replies
correct-apricot
correct-apricot7d ago
where do you want to read it?
provincial-silver
provincial-silverOP7d ago
I have an express server running start, I need to read it in a separate middleware The whole reason I’m even running the express server is only because I need to proxy all requests to /api/* to a separate api server. So if there is a cleaner way to achieve that then that works too
correct-apricot
correct-apricot7d ago
the proxying should be doable via a request Middleware in start itself you can also run express inside start

Did you find this page helpful?