HttpRoutes

org.http4s.HttpRoutes$
object HttpRoutes

Functions for creating HttpRoutes kleislis.

Attributes

Source:
HttpRoutes.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Value members

Concrete methods

def apply[F[_] : Monad](run: Request[F] => OptionT[F, Response[F]]): HttpRoutes[F]

Lifts a function into an HttpRoutes. The application of run is suspended in F to permit more efficient combination of routes via SemigroupK.

Lifts a function into an HttpRoutes. The application of run is suspended in F to permit more efficient combination of routes via SemigroupK.

Attributes

F

the effect of the HttpRoutes

run

the function to lift

Returns:

an HttpRoutes that wraps run

Source:
HttpRoutes.scala
def empty[F[_] : Applicative]: HttpRoutes[F]

An empty set of routes. Always responds with OptionT.none.

An empty set of routes. Always responds with OptionT.none.

Attributes

F

the base effect of the HttpRoutes

Source:
HttpRoutes.scala
def liftF[F[_]](fr: OptionT[F, Response[F]]): HttpRoutes[F]

Lifts an effectful Response into an HttpRoutes.

Lifts an effectful Response into an HttpRoutes.

Attributes

F

the effect of the HttpRoutes

fr

the effectful Response to lift

Returns:

an HttpRoutes that always returns fr

Source:
HttpRoutes.scala
def local[F[_] : Monad](f: Request[F] => Request[F])(fa: HttpRoutes[F]): HttpRoutes[F]

Transforms an HttpRoutes on its input. The application of the transformed function is suspended in F to permit more efficient combination of routes via SemigroupK.

Transforms an HttpRoutes on its input. The application of the transformed function is suspended in F to permit more efficient combination of routes via SemigroupK.

Attributes

F

the base effect of the HttpRoutes

f

a function to apply to the Request

fa

the HttpRoutes to transform

Returns:

An HttpRoutes whose input is transformed by f before being applied to fa

Source:
HttpRoutes.scala
def of[F[_] : Monad](pf: PartialFunction[Request[F], F[Response[F]]]): HttpRoutes[F]

Lifts a partial function into an HttpRoutes. The application of the partial function is suspended in F to permit more efficient combination of routes via SemigroupK.

Lifts a partial function into an HttpRoutes. The application of the partial function is suspended in F to permit more efficient combination of routes via SemigroupK.

Attributes

F

the base effect of the HttpRoutes - Defer suspends evaluation of routes, so only 1 section of routes is checked at a time.

pf

the partial function to lift

Returns:

An HttpRoutes that returns some Response in an OptionT[F, *] wherever pf is defined, an OptionT.none wherever it is not

Source:
HttpRoutes.scala
def pure[F[_]](r: Response[F])(implicit FO: Applicative[[_] =>> OptionT[F, _$4]]): HttpRoutes[F]

Lifts a Response into an HttpRoutes.

Lifts a Response into an HttpRoutes.

Attributes

F

the base effect of the HttpRoutes

r

the Response to lift

Returns:

an HttpRoutes that always returns r in effect OptionT[F, *]

Source:
HttpRoutes.scala

Lifts a partial function into an HttpRoutes. The application of the partial function is not suspended in F, unlike of. This allows for less constraints when not combining many routes.

Lifts a partial function into an HttpRoutes. The application of the partial function is not suspended in F, unlike of. This allows for less constraints when not combining many routes.

Attributes

F

the base effect of the HttpRoutes

pf

the partial function to lift

Returns:

An HttpRoutes that returns some Response in an OptionT[F, *] wherever pf is defined, an OptionT.none wherever it is not

Source:
HttpRoutes.scala