Skip to content

Commit

Permalink
Add Server.serve variant that accepts Route (#2805) (#2895)
Browse files Browse the repository at this point in the history
  • Loading branch information
987Nabil authored Jun 7, 2024
1 parent a5fdfc1 commit a78e863
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions zio-http/shared/src/main/scala/zio/http/Server.scala
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,13 @@ object Server extends ServerPlatformSpecific {
ZIO.never
}

def serve[R](
route: Route[R, Response],
routes: Route[R, Response]*,
)(implicit trace: Trace, tag: EnvironmentTag[R]): URIO[R with Server, Nothing] = {
serve(Routes(route, routes: _*))
}

def install[R](
httpApp: Routes[R, Response],
)(implicit trace: Trace, tag: EnvironmentTag[R]): URIO[R with Server, Int] = {
Expand Down

0 comments on commit a78e863

Please sign in to comment.