Skip to content

Commit 6a7fa5c

Browse files
committed
updated build.sbt, Main.scala
1 parent dbb0b11 commit 6a7fa5c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

frameworks/Scala/zio-http/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name := "zio-http"
22
version := "1.0.0"
3-
scalaVersion := "2.13.6"
3+
scalaVersion := "2.13.14"
44
lazy val root = (project in file("."))
55
.settings(
66
libraryDependencies += "dev.zio" %% "zio-http" % "3.0.0-RC10",

frameworks/Scala/zio-http/src/main/scala/Main.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ import zio._
22
import zio.http._
33
import zio.http.netty.NettyConfig
44
import zio.http.netty.NettyConfig.LeakDetectionLevel
5+
import java.lang.{Runtime => JRuntime}
56

67
object Main extends ZIOAppDefault {
78

89
private val plainTextMessage: String = "hello, world!"
910
private val jsonMessage: String = """{"message": "hello, world!"}"""
1011

1112
private val STATIC_SERVER_NAME = "zio-http"
12-
private val NUM_PROCESSORS = Runtime.getRuntime.availableProcessors()
13+
private val NUM_PROCESSORS = JRuntime.getRuntime.availableProcessors()
1314

1415
val app: Routes[Any, Response] = Routes(
1516
Method.GET / "/plaintext" ->
@@ -38,5 +39,5 @@ object Main extends ZIOAppDefault {
3839
private val nettyConfigLayer = ZLayer.succeed(nettyConfig)
3940

4041
val run: UIO[ExitCode] =
41-
Server.serve(app.toHttpApp).provide(configLayer, nettyConfigLayer, Server.customized).exitCode
42+
Server.serve(app).provide(configLayer, nettyConfigLayer, Server.customized).exitCode
4243
}

0 commit comments

Comments
 (0)