(
method: "*" | HttpMethod.HttpMethod,
path: PathInput,
handler:
| HttpServerResponse.HttpServerResponse
| Effect.Effect<HttpServerResponse.HttpServerResponse, E, R>
| ((request: HttpServerRequest.HttpServerRequest) => Effect.Effect<HttpServerResponse.HttpServerResponse, E, R>),
options?: {
readonly uninterruptible?: boolean | undefined
}
)
| 667 | * @since 4.0.0 |
| 668 | */ |
| 669 | export const route = <E = never, R = never>( |
| 670 | method: "*" | HttpMethod.HttpMethod, |
| 671 | path: PathInput, |
| 672 | handler: |
| 673 | | HttpServerResponse.HttpServerResponse |
| 674 | | Effect.Effect<HttpServerResponse.HttpServerResponse, E, R> |
| 675 | | ((request: HttpServerRequest.HttpServerRequest) => Effect.Effect<HttpServerResponse.HttpServerResponse, E, R>), |
| 676 | options?: { |
| 677 | readonly uninterruptible?: boolean | undefined |
| 678 | } |
| 679 | ): Route<E, Exclude<R, Provided>> => |
| 680 | makeRoute({ |
| 681 | ...options, |
| 682 | method, |
| 683 | path, |
| 684 | handler: HttpServerResponse.isHttpServerResponse(handler) ? |
| 685 | Effect.succeed(handler) : |
| 686 | Effect.isEffect(handler) |
| 687 | ? handler |
| 688 | : Effect.flatMap(HttpServerRequest.HttpServerRequest, handler), |
| 689 | uninterruptible: options?.uninterruptible ?? false |
| 690 | }) |
| 691 | |
| 692 | /** |
| 693 | * Path pattern accepted by the router. Routes must use an absolute path |
no test coverage detected