module Framework: sig
.. end
type
req = Http.Request.request * Router.params
type
res = Http.Response.response
type
route = {
|
meth : string ; |
|
pattern : string ; |
|
handler : req -> res -> res ; |
}
type
server = {
}
val create_server : unit -> server
val not_found : Http.Request.request -> Http.Response.response -> Http.Response.response
val route : server -> Http.Request.request -> res -> res
val get : string ->
(req -> res -> res) ->
server -> server
val post : string ->
(req -> res -> res) ->
server -> server
val respond : string -> Http.Response.response -> Http.Response.response
val param : 'a * ('b * 'c) list -> 'b -> 'c
val listen : int -> server -> unit