tiny_httpd

Minimal HTTP server using good old threads
IN THIS PACKAGE
Module Tiny_httpd . Route

Routing

Basic type-safe routing.

  • since 0.6
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 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 (@/) : ( 'a, 'b ) comp -> ( 'b, 'c ) t -> ( 'a, 'c ) t

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