HttpApp.ts overview
Since v1.0.0
Exports Grouped by Category
combinators
toHandled
Signature
declare const toHandled: <E, R, _, EH, RH>(
self: Default<E, R>,
handleResponse: (
request: ServerRequest.HttpServerRequest,
response: ServerResponse.HttpServerResponse
) => Effect.Effect<_, EH, RH>,
middleware?: HttpMiddleware | undefined
) => Effect.Effect<void, never, Exclude<R | RH | ServerRequest.HttpServerRequest, Scope.Scope>>
Since v1.0.0
conversions
toWebHandler
Signature
declare const toWebHandler: <E>(
self: Default<E, Scope.Scope>,
middleware?: HttpMiddleware | undefined
) => (request: Request, context?: Context.Context<never> | undefined) => Promise<Response>
Since v1.0.0
toWebHandlerLayer
Signature
declare const toWebHandlerLayer: <E, R, RE>(
self: Default<E, R | Scope.Scope>,
layer: Layer.Layer<R, RE>,
middleware?: HttpMiddleware | undefined
) => {
readonly close: () => Promise<void>
readonly handler: (request: Request, context?: Context.Context<never> | undefined) => Promise<Response>
}
Since v1.0.0
toWebHandlerRuntime
Signature
declare const toWebHandlerRuntime: <R>(
runtime: Runtime.Runtime<R>
) => <E>(
self: Default<E, R | Scope.Scope>,
middleware?: HttpMiddleware | undefined
) => (request: Request, context?: Context.Context<never> | undefined) => Promise<Response>
Since v1.0.0
fiber refs
appendPreResponseHandler
Signature
declare const appendPreResponseHandler: (handler: PreResponseHandler) => Effect.Effect<void>
Since v1.0.0
currentPreResponseHandlers
Signature
declare const currentPreResponseHandlers: FiberRef.FiberRef<Option.Option<PreResponseHandler>>
Since v1.0.0
withPreResponseHandler
Signature
declare const withPreResponseHandler: any
Since v1.0.0
models
Default (type alias)
Signature
type Effect.Effect<A, E, ServerRequest.HttpServerRequest | R> = HttpApp<ServerResponse.HttpServerResponse, E, R>
Since v1.0.0
HttpApp (type alias)
Signature
type Effect.Effect<A, E, ServerRequest.HttpServerRequest | R> = Effect.Effect<
A,
E,
R | ServerRequest.HttpServerRequest
>
Since v1.0.0
PreResponseHandler (type alias)
Signature
type PreResponseHandler = (
request: ServerRequest.HttpServerRequest,
response: ServerResponse.HttpServerResponse
) => Effect.Effect<ServerResponse.HttpServerResponse, ServerError.ResponseError>
Since v1.0.0