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
Value members
Concrete methods
Returns the concatenation of these routes with the specified routes.
Returns the concatenation of these routes with the specified routes.
Attributes
Prepends the specified route to this collection of routes.
Prepends the specified route to this collection of routes.
Attributes
Appends the specified route to this collection of routes.
Appends the specified route to this collection of routes.
Attributes
Handles all typed errors in the routes by converting them into responses. This method can be used to convert routes that do not handle their errors into ones that do handle their errors.
Handles all typed errors in the routes by converting them into responses. This method can be used to convert routes that do not handle their errors into ones that do handle their errors.
Attributes
Handles all typed errors, as well as all non-recoverable errors, by converting them into responses. This method can be used to convert routes that do not handle their errors into ones that do handle their errors.
Handles all typed errors, as well as all non-recoverable errors, by converting them into responses. This method can be used to convert routes that do not handle their errors into ones that do handle their errors.
Attributes
Handles all typed errors, as well as all non-recoverable errors, by converting them into a ZIO effect that produces the response. This method can be used to convert routes that do not handle their errors into ones that do handle their errors.
Handles all typed errors, as well as all non-recoverable errors, by converting them into a ZIO effect that produces the response. This method can be used to convert routes that do not handle their errors into ones that do handle their errors.
Attributes
Handles all typed errors in the routes by converting them into responses, taking into account the request that caused the error. This method can be used to convert routes that do not handle their errors into ones that do handle their errors.
Handles all typed errors in the routes by converting them into responses, taking into account the request that caused the error. This method can be used to convert routes that do not handle their errors into ones that do handle their errors.
Attributes
Handles all typed errors in the routes by converting them into responses, taking into account the request that caused the error. This method can be used to convert routes that do not handle their errors into ones that do handle their errors.
Handles all typed errors in the routes by converting them into responses, taking into account the request that caused the error. This method can be used to convert routes that do not handle their errors into ones that do handle their errors.
Attributes
Handles all typed errors, as well as all non-recoverable errors, by converting them into a ZIO effect that produces the response, taking into account the request that caused the error. This method can be used to convert routes that do not handle their errors into ones that do handle their errors.
Handles all typed errors, as well as all non-recoverable errors, by converting them into a ZIO effect that produces the response, taking into account the request that caused the error. This method can be used to convert routes that do not handle their errors into ones that do handle their errors.
Attributes
Allows the transformation of the Err type through a function allowing one to build up a Routes in Stages delegates to the Route
Allows the transformation of the Err type through a function allowing one to build up a Routes in Stages delegates to the Route
Attributes
Allows the transformation of the Err type through an Effectful program allowing one to build up a Routes in Stages delegates to the Route
Allows the transformation of the Err type through an Effectful program allowing one to build up a Routes in Stages delegates to the Route
Attributes
Returns new routes that have each been provided the specified environment, thus eliminating their requirement for any specific environment.
Returns new routes that have each been provided the specified environment, thus eliminating their requirement for any specific environment.
Attributes
Returns new routes that automatically translate all failures into responses, using best-effort heuristics to determine the appropriate HTTP status code, and attaching error details using the HTTP header Warning
.
Returns new routes that automatically translate all failures into responses, using best-effort heuristics to determine the appropriate HTTP status code, and attaching error details using the HTTP header Warning
.
Attributes
Returns new routes that are all timed out by the specified maximum duration.
Returns new routes that are all timed out by the specified maximum duration.
Attributes
Converts the routes into an app, which can be done only when errors are handled and converted into responses.
Converts the routes into an app, which can be done only when errors are handled and converted into responses.