Skip to content
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

Astro Middleware documentation #3069

Closed
ematipico opened this issue Apr 18, 2023 · 2 comments
Closed

Astro Middleware documentation #3069

ematipico opened this issue Apr 18, 2023 · 2 comments
Labels
add new content Document something that is not in docs. May require testing, confirmation, or affect other pages.

Comments

@ematipico
Copy link
Member

ematipico commented Apr 18, 2023

The platform team is about the add a new feature in astro. The feature is called "Astro middleware".

Few useful links:

A middleware unlocks two major things:

  • do various operations based on the Request and Response, and also modify the Response before being rendered; a user can also return a new Response;
  • store contextual information inside a new global called Astro.locals/context.locals (they're the same object), and then render something based on this Astro.locals;
@ematipico
Copy link
Member Author

cc @withastro/maintainers-docs

@sarah11918 sarah11918 added the add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. label May 2, 2023
@sarah11918
Copy link
Member

Closing as initial documentation has been released! 🥳

Now, updates can be done by referencing the existing docs page!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add new content Document something that is not in docs. May require testing, confirmation, or affect other pages.
Projects
None yet
Development

No branches or pull requests

2 participants