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 hello = async () => 'hello world';

const message = await hello();

/**
 * @type {import("astro").MiddlewareResponseHandler}
 */
export const onRequest = async (context, next) => {
	const test = 'something';
	context.cookies.set('foo', 'bar');
	const response = await next();
	response.headers.set('x-message', message);	
	return response;
};

Domain

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 CoreAstro domain, RoutingSystem subdomain.
What functions are defined in middleware.js?
middleware.js defines 2 function(s): hello, onRequest.
Where is middleware.js in the architecture?
middleware.js is located at packages/integrations/vercel/test/fixtures/middleware-with-edge-file/src/middleware.js (domain: CoreAstro, subdomain: RoutingSystem, directory: packages/integrations/vercel/test/fixtures/middleware-with-edge-file/src).

Analyze Your Own Codebase

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

Try Supermodel Free