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

feat: middleware and virtual routes #7254

Merged
merged 12 commits into from
Mar 11, 2024
Prev Previous commit
Next Next commit
less confusing!
Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>
  • Loading branch information
sarah11918 and lilnasy authored Mar 11, 2024
commit 5bb5a46421c4ca89ffcdc1687664e35d030253f6
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/middleware.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro';

**Middleware** allows you to intercept requests and responses and inject behaviors dynamically every time a page or endpoint is about to be rendered. This rendering occurs at build time for all prerendered pages, but occurs when the route is requested for pages rendered on demand.

Middleware also allows you to set and share request-specific information across endpoints and pages by mutating a `locals` object that is available in all Astro components and API endpoints. This object is available even when this middleware runs at build time, giving your static routes access to stored information during the lifecycle of a request.
Middleware also allows you to set and share request-specific information across endpoints and pages by mutating a `locals` object that is available in all Astro components and API endpoints. This object is available even when this middleware runs at build time.

## Basic Usage

Expand Down
Loading