MCPcopy Index your code
hub / github.com/Effect-TS/effect / middlewareAdd

Function middlewareAdd

packages/platform/src/HttpApiBuilder.ts:885–894  ·  view source on GitHub ↗
(
  middleware: HttpMiddleware.HttpMiddleware
)

Source from the content-addressed store, hash-verified

883) => HttpApp.Default<Error, R>
884
885const middlewareAdd = (
886 middleware: HttpMiddleware.HttpMiddleware
887): Effect.Effect<void, never, Middleware> =>
888 Effect.gen(function*() {
889 const context = yield* Effect.context<never>()
890 const service = yield* Middleware
891 yield* service.add((httpApp) =>
892 Effect.mapInputContext(middleware(httpApp), (input) => Context.merge(context, input))
893 )
894 })
895
896const middlewareAddNoContext = (
897 middleware: HttpMiddleware.HttpMiddleware

Callers

nothing calls this directly

Calls 4

mergeMethod · 0.80
middlewareFunction · 0.70
contextMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected