MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / onRequest

Function onRequest

examples/astro/src/middleware.ts:4–13  ·  view source on GitHub ↗
(
	context: APIContext,
	next: () => ReturnType<APIRoute>,
)

Source from the content-addressed store, hash-verified

2import {mapMetaEnvToProcessEnv} from './lib/utils';
3
4export function onRequest(
5 context: APIContext,
6 next: () => ReturnType<APIRoute>,
7): ReturnType<APIRoute> {
8 // Map the meta environment variables to process environment variables
9 mapMetaEnvToProcessEnv();
10
11 // Return a Response or the result of calling `next()`
12 return next();
13}

Callers

nothing calls this directly

Calls 2

mapMetaEnvToProcessEnvFunction · 0.90
nextFunction · 0.50

Tested by

no test coverage detected