diff --git a/webapi/src/main/scala/org/knora/webapi/Main.scala b/webapi/src/main/scala/org/knora/webapi/Main.scala index 3c648e16b9..a1e90c1d7c 100644 --- a/webapi/src/main/scala/org/knora/webapi/Main.scala +++ b/webapi/src/main/scala/org/knora/webapi/Main.scala @@ -30,5 +30,5 @@ object Main extends ZIOApp { * Entrypoint of our Application */ override def run: ZIO[Environment with ZIOAppArgs with Scope, Any, Any] = - InstrumentationServer.make *> AppServer.make *> ZIO.never + AppServer.make *> InstrumentationServer.make } diff --git a/webapi/src/main/scala/org/knora/webapi/core/InstrumentationServer.scala b/webapi/src/main/scala/org/knora/webapi/core/InstrumentationServer.scala index 771e049881..a92ea0ffa2 100644 --- a/webapi/src/main/scala/org/knora/webapi/core/InstrumentationServer.scala +++ b/webapi/src/main/scala/org/knora/webapi/core/InstrumentationServer.scala @@ -19,20 +19,20 @@ import org.knora.webapi.instrumentation.prometheus.PrometheusApp object InstrumentationServer { private val instrumentationServer = - for { + (for { index <- ZIO.serviceWith[IndexApp](_.route) health <- ZIO.serviceWith[HealthRouteZ](_.route) prometheus <- ZIO.serviceWith[PrometheusApp](_.route) app = index ++ health ++ prometheus - _ <- Server.serve(app).forkDaemon - } yield () + _ <- Server.install(app) + } yield ()) *> ZIO.never val make: ZIO[State with AppConfig, Throwable, Unit] = ZIO.serviceWithZIO[AppConfig] { config => val port = config.instrumentationServerConfig.port val interval = config.instrumentationServerConfig.interval val metricsConfig = MetricsConfig(interval) - ZIO.logInfo(s"Starting instrumentation http server on port: $port") *> + ZIO.logInfo(s"Starting instrumentation http server on http://localhost:$port") *> instrumentationServer .provideSome[State]( // HTTP Server diff --git a/webapi/src/main/scala/org/knora/webapi/instrumentation/index/IndexApp.scala b/webapi/src/main/scala/org/knora/webapi/instrumentation/index/IndexApp.scala index 6069c716a7..801add37c6 100644 --- a/webapi/src/main/scala/org/knora/webapi/instrumentation/index/IndexApp.scala +++ b/webapi/src/main/scala/org/knora/webapi/instrumentation/index/IndexApp.scala @@ -20,10 +20,12 @@ final case class IndexApp() { private val indexPage = """ |