A case class that enables the following syntax:
A case class that enables the following syntax:
val r: Router[Int / String] = Get / int / string val s: String = p /> { case i / s => s + i }
An alias for Router that maps route to a Service.
An universal extractor that extracts some value of type A
if it's possible to fetch the value from the string.
An universal matcher.
A Router0 that matches the given HTTP method m
in the route.
Add />
compositors to RouterN
to compose it with function of one argument.
Add />
compositors to RouterN
to compose it with function of one argument.
Add />
compositor to RouterN
to compose it with function of two argument.
Add />
compositor to RouterN
to compose it with function of three argument.
Add />
compositor to RouterN
to compose it with function of four argument.
An exception, which is thrown by router in case of missing route r
.
A user friendly alias for RouterN.
A router that match the given route to some predicate.
A router that extracts some value of the type A
from the given route.
A Router0 that skips one route token.
A Router0 that skips all route tokens.
A RouterN that extracts a path token.
A RouterN that extract a boolean value from the route.
Implicitly converts the given Router[Service[_, _]]
into a service.
A RouterN that extract an integer from the route.
A RouterN that extract a long value from the route.
A RouterN that extract a string value from the route.
This package contains various of functions and types that enable _router combinators_ in Finch. A Finch Router is an abstraction that is responsible for routing the HTTP requests using their method and path information. There are two types of routers in Finch: Router0 and RouterN.
Router0
matches the route and returns anOption
of the rest of the route.RouterN[A]
(or justRouter[A]
) in addition to theRouter0
behaviour extracts a value of typeA
from the route.A Router that maps route to a Service is called an Endpoint. An endpoint
Req => Rep
might be implicitly converted into aService[Req, Rep]
. Thus, the following example is a valid Finch code: