MCPcopy Create free account
hub / github.com/Effect-TS/effect / applyMiddleware

Function applyMiddleware

packages/effect/src/unstable/http/HttpRouter.ts:132–137  ·  view source on GitHub ↗
(effect: Effect.Effect<HttpServerResponse.HttpServerResponse>)

Source from the content-addressed store, hash-verified

130 Effect.contextWith((context: Context.Context<never>) => {
131 const middleware = getMiddleware(context)
132 const applyMiddleware = (effect: Effect.Effect<HttpServerResponse.HttpServerResponse>) => {
133 for (let i = 0; i < middleware.length; i++) {
134 effect = middleware[i](effect)
135 }
136 return effect
137 }
138 for (let i = 0; i < routes.length; i++) {
139 const route = middleware.length === 0 ? routes[i] : makeRoute({
140 ...routes[i],

Callers 1

addAllFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected