Skip to content

Commit

Permalink
Add ResourceInfoRoute to Server
Browse files Browse the repository at this point in the history
  • Loading branch information
seakayone committed Dec 13, 2022
1 parent 34b5447 commit 66b0a80
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,23 @@

package org.knora.webapi.core

import zhttp.service.Server
import zio.ZLayer
import zio._

import org.knora.webapi.config.AppConfig
import org.knora.webapi.routing.HealthRouteWithZIOHttp
import org.knora.webapi.slice.resourceinfo.api.{ResourceInfoRoute, RestResourceInfoService}
import zhttp.service.Server
import zio.{ZLayer, _}

object HttpServerWithZIOHttp {

val routes = HealthRouteWithZIOHttp()
val routes = HealthRouteWithZIOHttp() ++ ResourceInfoRoute()

val layer: ZLayer[AppConfig & State, Nothing, Unit] =
val layer: ZLayer[RestResourceInfoService with State with AppConfig, Nothing, Unit] =
ZLayer {
for {
appConfig <- ZIO.service[AppConfig]
port = appConfig.knoraApi.externalZioPort
_ <- Server.start(port, routes).forkDaemon
_ <- ZIO.logInfo(">>> Acquire ZIO HTTP Server <<<")
_ <- ZIO.logInfo(s">>> Acquire ZIO HTTP Server on port $port<<<")
} yield ()
}

}

0 comments on commit 66b0a80

Please sign in to comment.