( api: Pick<HttpApi.Top, "annotations">, group: HttpApiGroup.Top, handler: HandlerRuntime, context: Context.Context<any> )
| 1072 | * @internal |
| 1073 | */ |
| 1074 | export function handlerToRoute( |
| 1075 | api: Pick<HttpApi.Top, "annotations">, |
| 1076 | group: HttpApiGroup.Top, |
| 1077 | handler: HandlerRuntime, |
| 1078 | context: Context.Context<any> |
| 1079 | ): HttpRouter.Route<any, any> { |
| 1080 | const endpoint = handler.endpoint |
| 1081 | const path = HttpApiPath.toRouterPath(endpoint.path, endpoint.params) |
| 1082 | const redactedParams = HttpApi.getEndpointRedactedParams(api, group, endpoint) |
| 1083 | return HttpRouter.route( |
| 1084 | endpoint.method, |
| 1085 | path as HttpRouter.PathInput, |
| 1086 | handlerToHttpEffect(api, group, endpoint, context, handler.handler, handler.isRaw), |
| 1087 | { |
| 1088 | uninterruptible: handler.uninterruptible, |
| 1089 | redactedParams: redactedParams.all |
| 1090 | ? [...redactedParams.names, ...RedactedPath.allParamNames(path)] |
| 1091 | : redactedParams.names |
| 1092 | } |
| 1093 | ) |
| 1094 | } |
| 1095 | |
| 1096 | const applyMiddleware = <Group extends HttpApiGroup.Constraint, A extends Effect.Effect<any, any, any>>( |
| 1097 | group: Group, |
no test coverage detected