Skip to content

Commit

Permalink
Implement Routes#apply (#2550)
Browse files Browse the repository at this point in the history
implement routes#apply
  • Loading branch information
adamgfraser authored Dec 8, 2023
1 parent 6e230b9 commit f9ffb0b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions zio-http/src/main/scala/zio/http/Routes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ final class Routes[-Env, +Err] private (val routes: Chunk[zio.http.Route[Env, Er
def @@[Env1 <: Env](aspect: Middleware[Env1]): Routes[Env1, Err] =
aspect(self)

def apply(request: Request)(implicit ev: Err <:< Response, trace: Trace): ZIO[Env, Response, Response] =
self.toHttpApp.apply(request)

def asEnvType[Env2](implicit ev: Env2 <:< Env): Routes[Env2, Err] =
self.asInstanceOf[Routes[Env2, Err]]

Expand Down

0 comments on commit f9ffb0b

Please sign in to comment.