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

Function handlerToRoute

packages/effect/src/unstable/httpapi/HttpApiBuilder.ts:836–848  ·  view source on GitHub ↗
(
  group: HttpApiGroup.Top,
  handler: HandlerRuntime,
  context: Context.Context<any>
)

Source from the content-addressed store, hash-verified

834
835/** @internal */
836export function handlerToRoute(
837 group: HttpApiGroup.Top,
838 handler: HandlerRuntime,
839 context: Context.Context<any>
840): HttpRouter.Route<any, any> {
841 const endpoint = handler.endpoint
842 return HttpRouter.route(
843 endpoint.method,
844 endpoint.path as HttpRouter.PathInput,
845 handlerToHttpEffect(group, endpoint, context, handler.handler, handler.isRaw),
846 { uninterruptible: handler.uninterruptible }
847 )
848}
849
850const applyMiddleware = <Group extends HttpApiGroup.Constraint, A extends Effect.Effect<any, any, any>>(
851 group: Group,

Callers 1

groupFunction · 0.85

Calls 1

handlerToHttpEffectFunction · 0.85

Tested by

no test coverage detected