arouter.pl -- Alternative HTTP routing

HTTP routing with path expressions.

 route(?Method, ?Route, ?Before, ?Goal) is nondet
Retrieves currently registered routes.
 route_get(+Route, :Goal) is det
Registers a new GET route handler.
 route_put(+Route, :Goal) is det
Registers a new PUT route handler.
 route_del(+Route, :Goal) is det
Registers a new DELETE route handler.
 route_post(+Route, :Goal) is det
Registers a new POST route handler.
 route_get(+Route, :Before, :Goal) is det
Registers a new GET route handler. Accepts Before goal.
 route_put(+Route, :Before, :Goal) is det
Registers a new PUT route handler. Accepts Before goal.
 route_del(+Route, :Before, :Goal) is det
Registers a new DELETE route handler. Accepts Before goal.
 route_post(+Route, :Before, :Goal) is det
Registers a new POST route handler. Accepts Before goal.
 new_route(+Method, +Route, :Before, :Goal) is det
Registers a new method-specific route handler. Does nothing when the route already exists for the method.
 new_route(+Method, +Route, :Goal) is det
Registers a new method-specific route handler. Does nothing when the route already exists for the method.
 route_remove(+Method, +Route) is det
Removes the given route. When either Method or Route or both are not set or are partially instantiated then all matching routes are removed. Method can be left unbound.
 route(+Request) is semidet
Routes the request into an handler. Fails when no handler is found. Request must contain method(Method) and path(Path). Throws handler_failed(Method, Path) when handler was found but it failed during execution.
 path_to_route(+Path, -Route) is det
Turns path atom like '/path/to/something' into a Prolog term path/to/something.