FlowEndpointModule

PackageAxial.Hosting.GenHttp

Summary

NameSignatureSynopsis
Operations
flowEndpointWithOptionsflowEndpointWithOptions options getAppEnvironment mapApplicationError workflowLowers an endpoint Flow to the native handler expected by GenHTTP routing.
flowEndpointflowEndpoint getAppEnvironment mapApplicationError workflowRuns a request with the runtime default log sink unless the flow installs its own.

Operations

kind:member

flowEndpointWithOptions

flowEndpointWithOptions options getAppEnvironment mapApplicationError workflow
Member
Lowers an endpoint Flow to the native handler expected by GenHTTP routing.

Parameters

NameTypeDescription
optionsEndpointOptionsOptional log sink; None leaves the runtime default unchanged.
getAppEnvironmentIRequest -> 'appConstructs or resolves the explicit application environment for the current request.
mapApplicationError'error -> HttpResponseMaps one expected application failure to a GenHTTP response plan.
workflowFlow<HttpEndpointEnv<'app>, EndpointError<'error>, HttpResponse>The complete endpoint Flow to execute.

Returns

Func<IRequest, ValueTask<IResponse>>

Verification Examples

let endpoint = flowEndpoint getAppEnvironment ApiError.toResponse
Inline.Create().Post("/signups", endpoint signupEndpoint)
kind:member

flowEndpoint

flowEndpoint getAppEnvironment mapApplicationError workflow
Member
Runs a request with the runtime default log sink unless the flow installs its own.

Parameters

NameTypeDescription
getAppEnvironmentIRequest -> 'a
mapApplicationError'b -> HttpResponse
workflowFlow<HttpEndpointEnv<'a>, EndpointError<'b>, HttpResponse>

Returns

Func<IRequest, ValueTask<IResponse>>