HttpApp

object HttpApp

Functions for creating HttpApp kleislis.

class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[F[_]](run: Request[F] => F[Response[F]])(implicit evidence$1: Monad[F]): HttpApp[F]

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

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

Type Params
F

the effect of the HttpApp.

Value Params
run

the function to lift

Returns

an HttpApp that wraps run

def liftF[F[_]](fr: F[Response[F]]): HttpApp[F]

Lifts an effectful Response into an HttpApp.

Lifts an effectful Response into an HttpApp.

Type Params
F

the effect of the HttpApp

Value Params
fr

the effectful Response to lift

Returns

an HttpApp that always returns fr

def local[F[_]](f: Request[F] => Request[F])(fa: HttpApp[F])(implicit F: Monad[F]): HttpApp[F]

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

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

Type Params
F

the effect of the HttpApp

Value Params
f

a function to apply to the Request

fa

the HttpApp to transform

Returns

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

def notFound[F[_]](implicit evidence$3: Applicative[F]): HttpApp[F]

An app that always returns 404 Not Found.

An app that always returns 404 Not Found.

def pure[F[_]](r: Response[F])(implicit evidence$2: Applicative[F]): HttpApp[F]

Lifts a Response into an HttpApp.

Lifts a Response into an HttpApp.

Type Params
F

the effect of the HttpApp

Value Params
r

the Response to lift

Returns

an Http that always returns r in effect F