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

Analyze Your Own Codebase

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

Try Supermodel Free