Up

module Netcgi_cgi

: sig

Classical CGI connector.

CGI scripts have poor performance as they are entirely re-run for each request (so it is not possible to cache in the running program database connections for example). Still they are suitable for moderate frequented websites (especially because they run everywhere) and for development.

#
val run : ?config:Netcgi.config -> ?output_type:Netcgi.output_type -> ?arg_store:Netcgi.arg_store -> ?exn_handler:Netcgi.exn_handler -> (Netcgi.cgi -> unit) -> unit

run f executes f cgi for each cgi request. Contrarily to the other connectors, CGI execute the whole code (even the one outside f) each time the script is accessed. Therefore, one cannot easily cache database connections,...

config Default: [root:Netcgi].default_config
output_type Default: `Direct ""
arg_store Default: `Automatic for all arguments.
exn_handler See [root:Netcgi].exn_handler. Default: delegate all exceptions to the default handler.
#
val is_cgi : unit -> bool

is_cgi says whether the script is run in a CGI environment. This allows for example to call the [root:Netcgi_test] module if it is not.

end