1
1
(* * Routing
2
2
3
- Basic type-safe routing of handlers based on URL paths. This is optional,
4
- it is possible to only define the root handler with something like
5
- {{: https://github.com/anuragsoni/routes/} Routes}.
3
+ Basic type-safe routing of handlers based on URL paths. This is optional, it
4
+ is possible to only define the root handler with something like
5
+ {{:https://github.com/anuragsoni/routes/} Routes}.
6
6
@since 0.6 *)
7
7
8
8
type ('a, 'b) comp
@@ -27,31 +27,31 @@ val return : ('a, 'a) t
27
27
(* * Matches the empty path. *)
28
28
29
29
val rest_of_path : (string -> 'a , 'a ) t
30
- (* * Matches a string, even containing ['/']. This will match
31
- the entirety of the remaining route.
32
- @since 0.7 *)
30
+ (* * Matches a string, even containing ['/']. This will match the entirety of the
31
+ remaining route.
32
+ @since 0.7 *)
33
33
34
34
val rest_of_path_urlencoded : (string -> 'a , 'a ) t
35
- (* * Matches a string, even containing ['/'], and URL-decode it (piecewise).
36
- This will match the entirety of the remaining route.
37
- @since 0.7 *)
35
+ (* * Matches a string, even containing ['/'], and URL-decode it (piecewise). This
36
+ will match the entirety of the remaining route.
37
+ @since 0.7 *)
38
38
39
39
val ( @/ ) : ('a, 'b) comp -> ('b, 'c) t -> ('a, 'c) t
40
- (* * [comp / route] matches ["foo/bar/…"] iff [comp] matches ["foo"],
41
- and [route] matches ["bar/…"]. *)
40
+ (* * [comp / route] matches ["foo/bar/…"] iff [comp] matches ["foo"], and [route]
41
+ matches ["bar/…"]. *)
42
42
43
43
val exact_path : string -> ('a , 'b ) t -> ('a , 'b ) t
44
44
(* * [exact_path "foo/bar/..." r] is equivalent to
45
- [exact "foo" @/ exact "bar" @/ ... @/ r]
46
- @since 0.11 **)
45
+ [exact "foo" @/ exact "bar" @/ ... @/ r]
46
+ @since 0.11 **)
47
47
48
48
val pp : Format .formatter -> _ t -> unit
49
49
(* * Print the route.
50
- @since 0.7 *)
50
+ @since 0.7 *)
51
51
52
52
val to_string : _ t -> string
53
53
(* * Print the route.
54
- @since 0.7 *)
54
+ @since 0.7 *)
55
55
56
56
val to_url : ('a , string ) t -> 'a
57
57
0 commit comments