middleware.ts — astro Source File
Architecture documentation for middleware.ts, a typescript file in the astro codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 0dd768b5_85c3_f808_5090_743124bf76df["middleware.ts"] c3c33304_f44d_798a_9c7b_a80c587ed267["node:https"] 0dd768b5_85c3_f808_5090_743124bf76df --> c3c33304_f44d_798a_9c7b_a80c587ed267 style 0dd768b5_85c3_f808_5090_743124bf76df fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import https from 'node:https';
export const onRequest = (context, next) => {
console.info(context.netlify);
context.locals.middleware = context?.locals?.netlify?.context?.geo?.country?.code ?? null;
context.locals.runtime = 'Deno' in globalThis ? 'Deno' : 'Node';
context.locals.title = 'Middleware';
context.locals.nodePrefixedImportExists = !!https;
return next();
};
Domain
Subdomains
Functions
Dependencies
- node:https
Source
Frequently Asked Questions
What does middleware.ts do?
middleware.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, CoreMiddleware subdomain.
What functions are defined in middleware.ts?
middleware.ts defines 1 function(s): onRequest.
What does middleware.ts depend on?
middleware.ts imports 1 module(s): node:https.
Where is middleware.ts in the architecture?
middleware.ts is located at packages/integrations/netlify/test/hosted/hosted-astro-project/src/middleware.ts (domain: CoreAstro, subdomain: CoreMiddleware, directory: packages/integrations/netlify/test/hosted/hosted-astro-project/src).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free