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. Product
  4. Equals
  5. PartialFunction
  6. Function1
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

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: PartialFunction[ZIO[Env, Response, Response], C]): PartialFunction[Request, C]
    Definition Classes
    PartialFunction
  7. def andThen[C](k: (ZIO[Env, Response, Response]) => C): PartialFunction[Request, C]
    Definition Classes
    PartialFunction → Function1
  8. 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
  9. def applyOrElse[A1 <: Request, B1 >: ZIO[Env, Response, Response]](x: A1, default: (A1) => B1): B1
    Definition Classes
    PartialFunction
  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  12. def compose[R](k: PartialFunction[R, Request]): PartialFunction[R, ZIO[Env, Response, Response]]
    Definition Classes
    PartialFunction
  13. def compose[A](g: (A) => Request): (A) => ZIO[Env, Response, Response]
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  14. def elementWise: ElementWiseExtractor[Request, ZIO[Env, Response, Response]]
    Definition Classes
    PartialFunction
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  17. 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
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def lift: (Request) => Option[ZIO[Env, Response, Response]]
    Definition Classes
    PartialFunction
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  23. def orElse[A1 <: Request, B1 >: ZIO[Env, Response, Response]](that: PartialFunction[A1, B1]): PartialFunction[A1, B1]
    Definition Classes
    PartialFunction
  24. def productElementNames: Iterator[String]
    Definition Classes
    Product
  25. 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.

  26. val routes: Routes[Env, Response]
  27. def run(method: Method = Method.GET, path: Path = Path.root, headers: Headers = Headers.empty, body: Body = Body.empty): ZIO[Env, Nothing, Response]
  28. def runWith[U](action: (ZIO[Env, Response, Response]) => U): (Request) => Boolean
    Definition Classes
    PartialFunction
  29. def runZIO(request: Request): ZIO[Env, Nothing, Response]

    An alias for apply.

  30. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  31. 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.

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

    Converts the HTTP application into a request handler.

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

    Accesses the underlying tree that provides fast dispatch to handlers.

  35. def unapply(a: Request): Option[ZIO[Env, Response, Response]]
    Definition Classes
    PartialFunction
  36. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  37. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  38. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

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

    (Since version 9)

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