Module EzAPIServerSource

include module type of struct include EzServer end
val server : ?catch:(string -> exn -> string EzAPIServerUtils.Answer.t Lwt.t) -> ?allow_origin:EzAPIServerUtils.Cors.allow_kind -> ?footer:string -> ?addr:string -> (int * EzAPIServerUtils.server_kind) list -> unit Lwt.t
val shutdown : unit -> unit Lwt.t
val set_debug : unit -> unit
include module type of struct include EzAPIServerUtils end
module Timings = EzAPIServerUtils.Timings
module Answer = EzAPIServerUtils.Answer
module GMTime = EzAPIServerUtils.GMTime
module Cors = EzAPIServerUtils.Cors

Server

Sourcetype server_kind = EzAPIServerUtils.server_kind =
  1. | API of Directory.t
  2. | Root of string * string option
Sourcetype server = EzAPIServerUtils.server = {
  1. server_port : int;
  2. server_kind : server_kind;
}

Utils

Sourceval return : ?code:??? -> ?headers:??? -> 'a -> 'a Answer.t Lwt.t
Sourceval return_ok : ?code:??? -> ?headers:??? -> 'a -> ('a, 'b) result Answer.t Lwt.t
Sourceval return_error : ?content:??? -> ?headers:??? -> int -> ('b, 'a option) result Answer.t Lwt.t

Register Handler

Sourceval register_res : ('a, 'b, 'c, 'd, [< EzAPI.Security.scheme ] as 'e) EzAPI.service -> ('a -> 'e list -> 'b -> ('c, 'd) result Answer.t Lwt.t) -> Directory.t -> (Directory.t, Dir_types.Step.t list * Dir_types.conflict) result
Sourceval register_ws_res : ('a, 'b, 'c, 'd, [< EzAPI.Security.scheme ] as 'e) EzAPI.service -> react:('a -> 'e list -> 'b -> ('c, 'd) result Lwt.t) -> bg:('a -> 'e list -> (('c, 'd) result -> unit) -> unit Lwt.t) -> ?onclose:??? -> ?step:??? -> Directory.t -> (Directory.t, Dir_types.Step.t list * Dir_types.conflict) result
Sourceexception Conflict of Dir_types.Step.t list * Dir_types.conflict
Sourceval register : ('a, 'b, 'c, 'd, [< EzAPI.Security.scheme ] as 'e) EzAPI.service -> ('a -> 'e list -> 'b -> ('c, 'd) result Answer.t Lwt.t) -> Directory.t -> Directory.t
Sourceval register_ws : ('a, 'b, 'c, 'd, [< EzAPI.Security.scheme ] as 'e) EzAPI.service -> ?onclose:??? -> ?step:??? -> react:('a -> 'e list -> 'b -> ('c, 'd) result Lwt.t) -> bg:('a -> 'e list -> (('c, 'd) result -> unit) -> unit Lwt.t) -> Directory.t -> Directory.t
Sourceval handle : ?meth:??? -> ?content_type:??? -> ?ws:??? -> ?allow_origin:??? -> file: (?meth:??? -> ?default:??? -> string -> string list -> string Answer.t Lwt.t) -> printf: ((string -> string -> unit Lwt.t, Format.formatter, unit, unit Lwt.t) format4 -> string -> string -> unit Lwt.t) -> server_kind -> Req.t -> string list -> string -> [> `http of string Answer.t | `ws of 'b ] Lwt.t