onRequest() — astro Function Reference
Architecture documentation for the onRequest() function in middleware.js from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 96392f51_3e07_dae9_ba89_04fa9bfc723a["onRequest()"] cb1ade2e_25ea_4688_acbc_e3596e81bb1c["middleware.js"] 96392f51_3e07_dae9_ba89_04fa9bfc723a -->|defined in| cb1ade2e_25ea_4688_acbc_e3596e81bb1c style 96392f51_3e07_dae9_ba89_04fa9bfc723a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/test/fixtures/astro-global/src/middleware.js lines 3–9
export function onRequest(ctx, next) {
Object.assign(ctx.locals, {
localsPattern: ctx.routePattern,
localsPrerendered: ctx.isPrerendered
});
return next()
}
Domain
Subdomains
Source
Frequently Asked Questions
What does onRequest() do?
onRequest() is a function in the astro codebase, defined in packages/astro/test/fixtures/astro-global/src/middleware.js.
Where is onRequest() defined?
onRequest() is defined in packages/astro/test/fixtures/astro-global/src/middleware.js at line 3.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free