package sihl
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=ada35566185af0fdde18aed448d23aa8
sha512=4d7cae8948061249246d0a19ad8c1ea3dc5238557d6055b9fee3479af1451d089047c96524516aaea20f0896662a79919d7107ddc8911dd036e11cd5cdd5df7c
doc/sihl/Sihl/Web/index.html
Module Sihl.WebSource
HTTP method
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.
get path ?middlewares handler returns a router with a single GET route containing the handler. The scope of the router is path.
head path ?middlewares handler returns a router with a single HEAD route containing the handler. The scope of the router is path.
options path ?middlewares handler returns a router with a single OPTIONS route containing the handler. The scope of the router is path.
post path ?middlewares handler returns a router with a single POST route containing the handler. The scope of the router is path.
put path ?middlewares handler returns a router with a single PUT route containing the handler. The scope of the router is path.
patch path ?middlewares handler returns a router with a single PATCH route containing the handler. The scope of the router is path.
delete path ?middlewares handler returns a router with a single DELETE route containing the handler. The scope of the router is path.
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.
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.
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.