MCPcopy Index your code
hub / github.com/solidjs/solid-start / wrapResponseMiddleware

Function wrapResponseMiddleware

packages/start/src/middleware/index.ts:33–43  ·  view source on GitHub ↗
(onBeforeResponse: ResponseMiddleware)

Source from the content-addressed store, hash-verified

31}
32
33function wrapResponseMiddleware(onBeforeResponse: ResponseMiddleware): Middleware {
34 return async (h3Event, next) => {
35 const resp = await next();
36
37 const fetchEvent = getFetchEvent(h3Event);
38 const mwResponse = await onBeforeResponse(fetchEvent, {
39 body: resp,
40 });
41 if (mwResponse) return mwResponse;
42 };
43}
44
45/**
46 * Creates middleware for handling requests and responses.

Callers 1

createMiddlewareFunction · 0.85

Calls 1

getFetchEventFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…