#How to pass an object from express to astro ssrHandler middleware?
5 messages · Page 1 of 1 (latest)
It looks like no-one has responded to your question yet. People might not be available right now or don’t know how to answer your question. Want an answer while you wait? Try asking our experimental bot in #1095492539085230272.
I don't think there's currently a way to directly pass data to the astro middeware, maybe you can create an API that the Astro middleware can consume?
What I did is pass data in environment variables, it works for node adapter, as it is the same process, (but not in serverless) So create in express, read in Astro. But it has to be a map of user sessions not to leak data between users, and it has to be serialized. The alternative would be to use a database, in memory or some new fancy key value store depending on your deployment. Now even deno offer it.
thanks for your reply, it will be a nice feature if it gets added in future