zio.http.Routes
See theRoutes companion object
Represents a collection of routes, each of which is defined by a pattern and a handler. This data type can be thought of as modeling a routing table, which decides where to direct every endpoint in an API based on both method and path of the request.
When you are done building a collection of routes, you typically convert the routes into an zio.http.HttpApp value, which can be done with the toHttpApp
method.
Routes may have handled or unhandled errors. A route of type Route[Env, Throwable]
, for example, has not handled its errors by converting them into responses. Such unfinished routes cannot yet be converted into zio.http.HttpApp values. First, you must handle errors with the handleError
or handleErrorCause
methods.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Members list
In this article