Skip to content

Commit

Permalink
fix: refactor for last features
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigoriiBerezin committed May 12, 2024
1 parent ac42dde commit 03762b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ object HelloWorldAdvanced extends ZIOAppDefault {
val configLayer = ZLayer.succeed(config)
val nettyConfigLayer = ZLayer.succeed(nettyConfig)

(fooBar ++ app).serve
(fooBar ++ app)
.serve[Any]
.provide(configLayer, nettyConfigLayer, Server.customized)
}
}
8 changes: 6 additions & 2 deletions zio-http/shared/src/main/scala/zio/http/Routes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,12 @@ final case class Routes[-Env, +Err](routes: Chunk[zio.http.Route[Env, Err]]) { s
/**
* A shortcut for `Server.install(routes) *> ZIO.never`
*/
def serve(implicit ev: Err <:< Response, trace: Trace): URIO[Env with Server, Nothing] = {
Server.serve(self.handleError(_.asInstanceOf[Response]))
def serve[Env1 <: Env](implicit
ev: Err <:< Response,
trace: Trace,
tag: EnvironmentTag[Env1],
): URIO[Env1 with Server, Nothing] = {
Server.serve[Env1](self.handleError(_.asInstanceOf[Response]))
}

def run(
Expand Down

0 comments on commit 03762b7

Please sign in to comment.