MCPcopy Create free account
hub / github.com/effect-app/libs / makeWebHandler

Function makeWebHandler

repos/effect/packages/platform-node/test/HttpApi.test.ts:511–531  ·  view source on GitHub ↗
(marker: string)

Source from the content-addressed store, hash-verified

509 )
510
511 const makeWebHandler = (marker: string) => {
512 const GroupLive = HttpApiBuilder.group(
513 Api,
514 "group",
515 (handlers) => handlers.handle("a", () => Effect.map(CurrentMarker, (marker) => ({ marker })))
516 )
517 const MLive = Layer.succeed(M)({
518 apiKey: (effect) => Effect.provideService(effect, CurrentMarker, marker)
519 })
520
521 return HttpRouter.toWebHandler(
522 Layer.mergeAll(
523 HttpApiBuilder.layer(Api).pipe(
524 Layer.provide(GroupLive),
525 Layer.provide(MLive),
526 Layer.provide(HttpServer.layerServices)
527 )
528 ),
529 { disableLogger: true }
530 )
531 }
532
533 const first = makeWebHandler("first")
534 const second = makeWebHandler("second")

Callers 1

HttpApi.test.tsFile · 0.85

Calls 6

groupMethod · 0.80
handleMethod · 0.65
mapMethod · 0.65
pipeMethod · 0.65
succeedMethod · 0.45
provideMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…