Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Yurt.Server
SourceServer
contains the methods needed to build a Yurt
server
type server = {
host : string;
port : int;
mutable routes : (string * Route.route * endpoint) list;
mutable tls_config : Conduit_lwt_unix.server_tls_config option;
mutable logger : Lwt_log.logger;
}
val server :
?tls_config:Conduit_lwt_unix.server_tls_config ->
?logger:Lwt_log.logger ->
string ->
int ->
server
Create a new server
Create a new server from an existing configuration file
val configure_tls :
?password:[ `Password of bool -> string | `No_password ] ->
server ->
string ->
string ->
server
Configure TLS after the server has been created
val stream :
?flush:bool ->
?headers:Header.t ->
?status:int ->
string Lwt_stream.t ->
(Response.t * Body.t) Lwt.t
Respond with a stream
val json :
?flush:bool ->
?headers:Header.t ->
?status:int ->
Ezjsonm.t ->
(Response.t * Body.t) Lwt.t
Respond with JSON data
val html :
?flush:bool ->
?headers:Header.t ->
?status:int ->
Yurt_html.t ->
(Response.t * Body.t) Lwt.t
Respond with HTML data
val string :
?flush:bool ->
?headers:Header.t ->
?status:int ->
string ->
(Response.t * Body.t) Lwt.t
Respond with string data
Respond with datas from file
Register a list of routes with the server
Register a single route with the server
Register a single route, formatted as a string, with the server
Regster endpoint that returns a single static file for all requests
Reqister endpoint that will serve files from a firectory