From 64c3218cf39a27b10209a2b5f703832351ea8d85 Mon Sep 17 00:00:00 2001 From: c-cube Date: Sat, 7 Jun 2025 02:31:59 +0000 Subject: [PATCH] deploy: 0f917ddf7289d7da49b49bb817fc53295b8db2bb --- tiny_httpd/Tiny_httpd_core/Route/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiny_httpd/Tiny_httpd_core/Route/index.html b/tiny_httpd/Tiny_httpd_core/Route/index.html index d0dfae85..fa661713 100644 --- a/tiny_httpd/Tiny_httpd_core/Route/index.html +++ b/tiny_httpd/Tiny_httpd_core/Route/index.html @@ -1,2 +1,2 @@ -Route (tiny_httpd.Tiny_httpd_core.Route)

Module Tiny_httpd_core.Route

Routing

Basic type-safe routing of handlers based on URL paths. This is optional, it is possible to only define the root handler with something like Routes.

type ('a, 'b) comp

An atomic component of a path

type ('a, 'b) t

A route, composed of path components

val int : (int -> 'a, 'a) comp

Matches an integer.

val string : (string -> 'a, 'a) comp

Matches a string not containing '/' and binds it as is.

val string_urlencoded : (string -> 'a, 'a) comp

Matches a URL-encoded string, and decodes it.

val exact : string -> ('a, 'a) comp

exact "s" matches "s" and nothing else.

val return : ('a, 'a) t

Matches the empty path.

val rest_of_path : (string -> 'a, 'a) t

Matches a string, even containing '/'. This will match the entirety of the remaining route.

  • since 0.7
val rest_of_path_urlencoded : (string -> 'a, 'a) t

Matches a string, even containing '/', and URL-decode it (piecewise). This will match the entirety of the remaining route.

  • since 0.7
val (@/) : ('a, 'b) comp -> ('b, 'c) t -> ('a, 'c) t

comp / route matches "foo/bar/…" iff comp matches "foo", and route matches "bar/…".

val exact_path : string -> ('a, 'b) t -> ('a, 'b) t

exact_path "foo/bar/..." r is equivalent to exact "foo" @/ exact "bar" @/ ... @/ r

  • since 0.11 *
val pp : Stdlib.Format.formatter -> (_, _) t -> unit

Print the route.

  • since 0.7
val to_string : (_, _) t -> string

Print the route.

  • since 0.7
module Private_ : sig ... end
+Route (tiny_httpd.Tiny_httpd_core.Route)

Module Tiny_httpd_core.Route

Routing

Basic type-safe routing of handlers based on URL paths. This is optional, it is possible to only define the root handler with something like Routes.

type ('a, 'b) comp

An atomic component of a path

type ('a, 'b) t

A route, composed of path components

val int : (int -> 'a, 'a) comp

Matches an integer.

val string : (string -> 'a, 'a) comp

Matches a string not containing '/' and binds it as is.

val string_urlencoded : (string -> 'a, 'a) comp

Matches a URL-encoded string, and decodes it.

val exact : string -> ('a, 'a) comp

exact "s" matches "s" and nothing else.

val return : ('a, 'a) t

Matches the empty path.

val rest_of_path : (string -> 'a, 'a) t

Matches a string, even containing '/'. This will match the entirety of the remaining route.

  • since 0.7
val rest_of_path_urlencoded : (string -> 'a, 'a) t

Matches a string, even containing '/', and URL-decode it (piecewise). This will match the entirety of the remaining route.

  • since 0.7
val (@/) : ('a, 'b) comp -> ('b, 'c) t -> ('a, 'c) t

comp / route matches "foo/bar/…" iff comp matches "foo", and route matches "bar/…".

val exact_path : string -> ('a, 'b) t -> ('a, 'b) t

exact_path "foo/bar/..." r is equivalent to exact "foo" @/ exact "bar" @/ ... @/ r

  • since 0.11 *
val pp : Stdlib.Format.formatter -> (_, _) t -> unit

Print the route.

  • since 0.7
val to_string : (_, _) t -> string

Print the route.

  • since 0.7
val to_url : ('a, string) t -> 'a
module Private_ : sig ... end