To focus the search input from anywhere on the page, press the 'S' key.
in-package search v0.1.0
Library
Module
Module type
Parameter
Class
Class type
module Request : sig ... end
module Response = Opium.Response
module Body = Opium.Body
module Cookie = Opium.Cookie
module Router = Opium.Router
module Route = Opium.Route
type handler = Request.t -> Response.t Lwt.t
A handler
returns a response given a request.
A router
has a scope, a list of routes and a list of middlewares. A mounted router prefixes all routes and applies the middlewares to them.
val get : string -> ?middlewares:Rock.Middleware.t list -> handler -> router
get path ?middlewares handler
returns a router with a single GET
route containing the handler
. The scope of the router is path
.
val head : string -> ?middlewares:Rock.Middleware.t list -> handler -> router
head path ?middlewares handler
returns a router with a single HEAD
route containing the handler
. The scope of the router is path
.
val options :
string ->
?middlewares:Rock.Middleware.t list ->
handler ->
router
options path ?middlewares handler
returns a router with a single OPTIONS
route containing the handler
. The scope of the router is path
.
val post : string -> ?middlewares:Rock.Middleware.t list -> handler -> router
post path ?middlewares handler
returns a router with a single POST
route containing the handler
. The scope of the router is path
.
val put : string -> ?middlewares:Rock.Middleware.t list -> handler -> router
put path ?middlewares handler
returns a router with a single PUT
route containing the handler
. The scope of the router is path
.
val patch : string -> ?middlewares:Rock.Middleware.t list -> handler -> router
patch path ?middlewares handler
returns a router with a single PATCH
route containing the handler
. The scope of the router is path
.
val delete : string -> ?middlewares:Rock.Middleware.t list -> handler -> router
delete path ?middlewares handler
returns a router with a single DELETE
route containing the handler
. The scope of the router is path
.
val any : string -> ?middlewares:Rock.Middleware.t list -> handler -> router
any path ?middlewares handler
returns a router with a single route containing the handler
. The scope of the router is path
. This route matches any HTTP method.
routes_of_router router
applies the middlewares, routes and the scope of a router
and returns a list of routes.
val choose :
?scope:string ->
?middlewares:Rock.Middleware.t list ->
router list ->
router
choose ?scope ?middlewares routers
returns a router by combining a list of routers
.
scope
is the new scope under which all routers
are mounted.
middlewares
is an optional list of middlewares that are applied for all routers
. By default, this list is empty.
routers
is the list of routers to combine.
externalize_path ?prefix path
returns a path with a prefix
added.
If no prefix
is provided, PREFIX_PATH
is used. If PREFIX_PATH
is not provided, the returned path equals the provided path.
module Http : sig ... end
module Csrf : sig ... end
module Flash : sig ... end
module Rest : sig ... end
This module allows you to build RESTful web pages quickly.
module Htmx : sig ... end
This module simplifies dealing with HTMX requests by adding type safe helpers to manipulate HTMX headers. Visit https://htmx.org/reference/ for the HTMX documentation.
module Id : sig ... end
module Session : sig ... end
module Middleware : sig ... end