package eliom

  1. Overview
  2. Docs
Advanced client/server Web and mobile framework

Install

Dune Dependency

Authors

Maintainers

Sources

11.1.1.tar.gz
md5=c8c67fe5fb8d3f44a3b17cc4a93a0e62
sha512=e58557a1b525efd011e0eb539b112b53e6c012ac3fb2153c251be030eda483dd3b19de625707cf5ffebd97fa6a7fabfb8a6aae8e8a61c79e0bd7ad2d289df9a9

doc/eliom.server/Eliom_client/index.html

Module Eliom_clientSource

Sourceval is_client_app : unit -> bool

Returns whether the application is sent by a server or started on client side. If called on server side, always returns false. Otherwise, it tests the presence of JS variables added automatically by Eliom when the page is sent by a server. Example:

    if not (Eliom_client.is_client_app ())
then Eliom_client.init_client_app ... 

RPC / Server functions

See the <<a_manual chapter="clientserver-communication" fragment="rpc"|manual>> .

Sourcetype ('a, 'b) server_function

A value of type ('a, 'b) server_function is created on the server from a function 'a -> 'b Lwt.t and provides a given function on the client side. See also <<a_api subproject="client" text="the concrete client side representation"| type Eliom_client.server_function>> .

Sourceval server_function : ?scope:[< Eliom_common.scope ] -> ?options:unit -> ?charset:string -> ?code:int -> ?content_type:string -> ?headers:Ocsigen_header.t -> ?secure_session:bool -> ?name:string -> ?csrf_safe:bool -> ?csrf_scope:[< Eliom_common.user_scope ] -> ?csrf_secure:bool -> ?max_use:int -> ?timeout:float -> ?https:bool -> ?error_handler:((string * exn) list -> 'b Lwt.t) -> 'a Deriving_Json.t -> ('a -> 'b Lwt.t) -> ('a, 'b) server_function

server_function argument_type f creates a value of type <<a_api | type Eliom_client.server_function>> . This allows to call f from the client. The first argument argument_type is an instance of Deriving_Json for the type of the argument. It is used to safely encode and decode the argument sent to the server.

The optional parameters correspond directly to the optional parameters of <<a_api|val Eliom_registration.Ocaml.register_coservice'>> .

See also the <<a_manual chapter="clientserver-communication" fragment="rpc"|manual>> .

OCaml

Innovation. Community. Security.