Handler : Type -> Type Handler is a type that represents a handler function
Visibility: public exportinterface Hoistable : (Type -> Type) -> Type- Parameters: m
Methods:
hoist : (a `m`) -> Handler a
Implementations:
Hoistable IO Hoistable Handler
hoist : Hoistable m => (a `m`) -> Handler a- Visibility: public export
record RouteItem : (Type -> Type) -> Type Route record type
Associates an API definition with its handler function
Totality: total
Visibility: public export
Constructor: (:=>) : (routeApi : API) -> GetHandlerType m routeApi -> MimeRender (VerbAccept (routeApi .verb)) (VerbResponse (routeApi .verb)) => FromJSON (ApiReqBody routeApi) => RouteItem m
Projections:
.mimeRenderProof : ({rec:0} : RouteItem m) -> MimeRender (VerbAccept ((routeApi {rec:0}) .verb)) (VerbResponse ((routeApi {rec:0}) .verb)) .reqBodyProof : ({rec:0} : RouteItem m) -> FromJSON (ApiReqBody (routeApi {rec:0})) .routeApi : RouteItem m -> API API definition, describes path and endpoint
.routeHandler : ({rec:0} : RouteItem m) -> GetHandlerType m (routeApi {rec:0}) Handler function, type is determined by the API definition
.routeApi : RouteItem m -> API API definition, describes path and endpoint
Visibility: public exportrouteApi : RouteItem m -> API API definition, describes path and endpoint
Visibility: public export.routeHandler : ({rec:0} : RouteItem m) -> GetHandlerType m (routeApi {rec:0}) Handler function, type is determined by the API definition
Visibility: public exportrouteHandler : ({rec:0} : RouteItem m) -> GetHandlerType m (routeApi {rec:0}) Handler function, type is determined by the API definition
Visibility: public export.mimeRenderProof : ({rec:0} : RouteItem m) -> MimeRender (VerbAccept ((routeApi {rec:0}) .verb)) (VerbResponse ((routeApi {rec:0}) .verb))- Visibility: public export
mimeRenderProof : ({rec:0} : RouteItem m) -> MimeRender (VerbAccept ((routeApi {rec:0}) .verb)) (VerbResponse ((routeApi {rec:0}) .verb))- Visibility: public export
.reqBodyProof : ({rec:0} : RouteItem m) -> FromJSON (ApiReqBody (routeApi {rec:0}))- Visibility: public export
reqBodyProof : ({rec:0} : RouteItem m) -> FromJSON (ApiReqBody (routeApi {rec:0}))- Visibility: public export
GetEndpointTypeFromRouteItem : (m : (Type -> Type)) -> RouteItem m -> Type- Visibility: public export
data Router : (Type -> Type) -> Type Server data type
Contains a set of route definitions for handling HTTP requests
Totality: total
Visibility: public export
Constructor: MkRouter : Hoistable m => List (RouteItem m) -> Router m Creates a server instance containing a list of routes
record ServerConfig : Type ServerConfig is a record type that contains server configuration
Contains server bind address and max connection count
@ return ServerConfig
Totality: total
Visibility: public export
Constructor: MkServerConfig : IP4Addr -> Nat -> ServerConfig
Projections:
.bind : ServerConfig -> IP4Addr Server bind IP address and port
.maxConns : ServerConfig -> Nat Max allowed connections
.bind : ServerConfig -> IP4Addr Server bind IP address and port
Visibility: public exportbind : ServerConfig -> IP4Addr Server bind IP address and port
Visibility: public export.maxConns : ServerConfig -> Nat Max allowed connections
Visibility: public exportmaxConns : ServerConfig -> Nat Max allowed connections
Visibility: public exportdefaultConfig : ServerConfig defaultConfig is a function that returns the default server configuration
Binds to 127.0.0.1:2222, max connections 128
@ return ServerConfig
Visibility: public export