package resto-cohttp-server
Module Resto_cohttp_server.ServerSource
Serving a directory of registered services.
type callback =
Cohttp_lwt_unix.Server.conn ->
Cohttp.Request.t ->
Cohttp_lwt.Body.t ->
Cohttp_lwt_unix.Server.response_action Lwt.tA callback passed to Cohttp_lwt_unix.Server.make_response_action. This type is used to define the middleware type.
A middleware function that wraps the operation of the Cohttp server that Resto builds, adding pieces of extra functionality on top of it at a low level when they cannot be implemented within the public Resto API.
We define a middleware as a transformer for the request -> response callback, which lets the middleware modify the arguments passed to the callback, run it, and then postprocess the response.
To use a middleware function, pass it to Make.launch.
Make_selfserver is a functor that produces only the machinery necessary for local use. Specifically, it produces the values and types needed for the Self_serving_client.