package yurt

  1. Overview
  2. Docs

Routes are used to build URLs with types variables

type route = [
  1. | `String of string
  2. | `Int of string
  3. | `Float of string
  4. | `Path of string
  5. | `Match of string * string
  6. | `Route of route list
]
exception Invalid_route_type

Invalid_route_type is raised when a value of the wrong type is requested

type params = (string, route) Stdlib.Hashtbl.t

Param map

val to_string : route -> string

Convert a route to string

val to_regexp : route -> Str.regexp

Convert a route to regular expressions

val of_string : string -> route

Create a Route from the given string

val params : route -> string -> params

Get parameters from a route

val string : params -> string -> string

Get a string parameter

val int : params -> string -> int

Get an int parameter

val float : params -> string -> float

Get a float parameter

val to_json : params -> Ezjsonm.t

Convert parameters to JSON

OCaml

Innovation. Community. Security.