package stog_server

  1. Overview
  2. Docs

Module Stog_server.PreviewSource

Stog preview

module S = Cohttp_lwt_unix.Server
Sourceval client_js : string

The javascript file containing client code for preview

Sourceval default_css : string

The default server CSS file in files embedded in server

Sourceval respond_js : string -> (Cohttp.Response.t * Cohttp_lwt__.Body.t) Lwt.t

Respond the given string with javascript mime-type.

Sourceval respond_css : string -> (Cohttp.Response.t * Cohttp_lwt__.Body.t) Lwt.t

Respond the given string with CSS mime-type.

Sourceval respond_server_client_js : (Cohttp.Response.t * Cohttp_lwt__.Body.t) Lwt.t

Respond the content of the given javascript file, looked up in server embedded files.

Sourceval respond_default_css : (Cohttp.Response.t * Cohttp_lwt__.Body.t) Lwt.t

Respond the default server CSS file

Sourceval handle_preview : http_url:Stog.Url.url_config -> ws_url:Stog.Url.url_config -> Run.state option ref -> Cohttp.Request.t -> string list -> (Cohttp.Response.t * Cohttp_lwt__.Body.t) Lwt.t

handle_preview http_url ws_url current_state req path responds the preview page, which contains a reference to client javascript code which, when loaded, will ask for stog document with path path.

Sourceval new_stog_session : Stog.Types.stog -> Stog.Url.t -> Run.state option ref * ('a * (Websocket.Frame.t -> unit Lwt.t)) list ref

new_stog_session stog stog_base_url returns a fresh stog state reference and a fresh connection list reference.

OCaml

Innovation. Community. Security.