-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add context to Node SSR adapter #3934
Conversation
🦋 Changeset detectedLatest commit: 09caf6e The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The reason that I made these changes is that I want to integrate Astro SSR into an existing Koa.js server, and that server uses Passport.js for authentication. Astro SSR fits in neatly as a Koa middleware, but without a way to pass information to the Astro components from the server, its usefulness is limited (for example, I need to be able to pass in the authentication information that is provided by Passport, and it is not trivial to recalculate this information inside the Astro components). |
Thanks for submitting this! The RFC is here: withastro/roadmap#230 for anyone reading this. Going to close this PR for now to keep the repo tidy. If the RFC is approved you can resubmit. Thanks again. |
Changes
Astro.context
which can be accessed by components and a newcontext
property on the argument passed into endpointscontext
into the handler in the Node.js adapterTesting
Astro.context
global works as expected during SSR.Docs
withastro/docs#1003