Dal_node.Proxy
The Proxy module provides functionality to create a proxy server that can intercept and mock responses for DAL node requests.
val route :
path:Re.Str.regexp ->
callback:
(path:string ->
fetch_answer:(unit -> Ezjsonm.t Lwt.t) ->
answer option Lwt.t) ->
route
Creates a route for the proxy, containing a path
pattern and a callback
. The callback
is provided with the path
actually matched together with a fetch_answer
callback to retrieve the DAL node answer for the given path
. The path
could be used when one wants to retreive path arguments. The fetch_answer
callback could be used when one only want to modify a field in the honest response.
val stop : proxy -> unit
Stops the proxy server.