final case class HttpApp[-Env](routes: Routes[Env, Response]) extends PartialFunction[Request, ZIO[Env, Response, Response]] with Product with Serializable

An HTTP application is a collection of routes, all of whose errors have been handled through conversion into HTTP responses.

HTTP applications can be installed into a zio.http.Server, which is capable of using them to serve requests.

Self Type
HttpApp[Env]
Annotations
@deprecated
Deprecated

(Since version 3.0.0-RC7) Use Routes instead. Will be removed in the next release.

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HttpApp
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. PartialFunction
  7. Function1
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HttpApp(routes: Routes[Env, Response])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def ++[Env1 <: Env](that: HttpApp[Env1]): HttpApp[Env1]

    Combines this HTTP application with the specified HTTP application.

    Combines this HTTP application with the specified HTTP application. In case of route conflicts, the routes in this HTTP application take precedence over the routes in the specified HTTP application.

  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. def @@[Env1 <: Env](aspect: Middleware[Env1]): HttpApp[Env1]

    Applies the specified route aspect to every route in the HTTP application.

  6. def andThen[C](k: (ZIO[Env, Response, Response]) ⇒ C): PartialFunction[Request, C]
    Definition Classes
    PartialFunction → Function1
  7. def apply(request: Request): ZIO[Env, Response, Response]

    Executes the HTTP application with the specified request input, returning an effect that will either succeed or fail with a Response.

    Executes the HTTP application with the specified request input, returning an effect that will either succeed or fail with a Response.

    Definition Classes
    HttpApp → Function1
  8. def applyOrElse[A1 <: Request, B1 >: ZIO[Env, Response, Response]](x: A1, default: (A1) ⇒ B1): B1
    Definition Classes
    PartialFunction
  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @IntrinsicCandidate()
  11. def compose[A](g: (A) ⇒ Request): (A) ⇒ ZIO[Env, Response, Response]
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  14. def isDefinedAt(request: Request): Boolean

    Checks to see if the HTTP application may be defined at the specified request input.

    Checks to see if the HTTP application may be defined at the specified request input. Note that it is still possible for an HTTP application to return a 404 Not Found response, which cannot be detected by this method. This method only checks for the presence of a handler that handles the method and path of the specified request.

    Definition Classes
    HttpApp → PartialFunction
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. def lift: (Request) ⇒ Option[ZIO[Env, Response, Response]]
    Definition Classes
    PartialFunction
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  20. def orElse[A1 <: Request, B1 >: ZIO[Env, Response, Response]](that: PartialFunction[A1, B1]): PartialFunction[A1, B1]
    Definition Classes
    PartialFunction
  21. def provideEnvironment(env: ZEnvironment[Env]): HttpApp[Any]

    Provides the specified environment to the HTTP application, returning a new HTTP application that has no environmental requirements.

  22. val routes: Routes[Env, Response]
  23. def run(method: Method = Method.GET, path: Path = Path.root, headers: Headers = Headers.empty, body: Body = Body.empty): ZIO[Env, Nothing, Response]
  24. def runWith[U](action: (ZIO[Env, Response, Response]) ⇒ U): (Request) ⇒ Boolean
    Definition Classes
    PartialFunction
  25. def runZIO(request: Request): ZIO[Env, Nothing, Response]

    An alias for apply.

  26. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  27. def timeout(duration: zio.Duration)(implicit trace: Trace): HttpApp[Env]

    Returns a new HTTP application whose requests will be timed out after the specified duration elapses.

  28. val toHandler: Handler[Env, Nothing, Request, Response]

    Converts the HTTP application into a request handler.

  29. def toString(): String
    Definition Classes
    Function1 → AnyRef → Any
  30. def tree(implicit trace: Trace): Tree[Env]

    Accesses the underlying tree that provides fast dispatch to handlers.

  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from PartialFunction[Request, ZIO[Env, Response, Response]]

Inherited from (Request) ⇒ ZIO[Env, Response, Response]

Inherited from AnyRef

Inherited from Any

Ungrouped