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

Function layerHttpRouter

packages/rpc/src/RpcServer.ts:763–787  ·  view source on GitHub ↗
(options: {
  readonly group: RpcGroup.RpcGroup<Rpcs>
  readonly path: HttpRouter.PathInput
  readonly protocol?: "http" | "websocket" | undefined
  readonly disableTracing?: boolean | undefined
  readonly spanPrefix?: string | undefined
  readonly spanAttributes?: Record<string, unknown> | undefined
  readonly concurrency?: number | "unbounded" | undefined
  readonly disableFatalDefects?: boolean | undefined
})

Source from the content-addressed store, hash-verified

761 * @category protocol
762 */
763export const layerHttpRouter = <Rpcs extends Rpc.Any>(options: {
764 readonly group: RpcGroup.RpcGroup<Rpcs>
765 readonly path: HttpRouter.PathInput
766 readonly protocol?: "http" | "websocket" | undefined
767 readonly disableTracing?: boolean | undefined
768 readonly spanPrefix?: string | undefined
769 readonly spanAttributes?: Record<string, unknown> | undefined
770 readonly concurrency?: number | "unbounded" | undefined
771 readonly disableFatalDefects?: boolean | undefined
772}): Layer.Layer<
773 never,
774 never,
775 | RpcSerialization.RpcSerialization
776 | HttpLayerRouter.HttpRouter
777 | Rpc.ToHandler<Rpcs>
778 | Rpc.Context<Rpcs>
779 | Rpc.Middleware<Rpcs>
780> =>
781 layer(options.group, options).pipe(
782 Layer.provide(
783 options.protocol === "http"
784 ? layerProtocolHttpRouter(options)
785 : layerProtocolWebsocketRouter(options)
786 )
787 )
788
789/**
790 * @since 1.0.0

Callers

nothing calls this directly

Calls 5

layerProtocolHttpRouterFunction · 0.85
layerFunction · 0.70
pipeMethod · 0.65
provideMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…