Home / File/ middleware.js — astro Source File

middleware.js — astro Source File

Architecture documentation for middleware.js, a javascript file in the astro codebase.

Entity Profile

Relationship Graph

Source Code



export const onRequest = async (context, next) => {
		if (context.url.pathname.startsWith("/404") || context.url.pathname.startsWith("/500")) {
			Object.assign(context.locals, {
				interjected: "Interjected"
			});
		}
		return  await next();
}

Subdomains

Functions

Frequently Asked Questions

What does middleware.js do?
middleware.js is a source file in the astro codebase, written in javascript. It belongs to the IntegrationAdapters domain, SsrAdapters subdomain.
What functions are defined in middleware.js?
middleware.js defines 1 function(s): onRequest.
Where is middleware.js in the architecture?
middleware.js is located at packages/astro/test/fixtures/rewrite-custom-404/src/middleware.js (domain: IntegrationAdapters, subdomain: SsrAdapters, directory: packages/astro/test/fixtures/rewrite-custom-404/src).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free