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 function onRequest(ctx, next) {
    if (ctx.url.pathname !== '/') {
        return new Response(null, { status: 404 });
    }
    return 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/custom-404-loop-case-4/src/middleware.js (domain: IntegrationAdapters, subdomain: SsrAdapters, directory: packages/astro/test/fixtures/custom-404-loop-case-4/src).

Analyze Your Own Codebase

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

Try Supermodel Free