From 02b5c7ebf195fb408798a08b9c0cd191c49d7c23 Mon Sep 17 00:00:00 2001 From: Thanh Le Date: Sat, 30 Nov 2024 20:03:07 +0100 Subject: [PATCH] Import http4s uri directly --- modules/app/src/main/scala/app.config.scala | 5 +++-- modules/ingestor/src/main/scala/app.config.scala | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/app/src/main/scala/app.config.scala b/modules/app/src/main/scala/app.config.scala index 01b0cc4..2047ff7 100644 --- a/modules/app/src/main/scala/app.config.scala +++ b/modules/app/src/main/scala/app.config.scala @@ -6,6 +6,7 @@ import cats.syntax.all.* import ciris.* import ciris.http4s.* import com.comcast.ip4s.* +import org.http4s.Uri import org.http4s.implicits.* object AppConfig: @@ -39,9 +40,9 @@ object HttpServerConfig: private def enableDocs = env("HTTP_ENABLE_DOCS").or(prop("http.enable.docs")).as[Boolean].default(false) def config = (host, port, logger, shutdownTimeout, enableDocs).parMapN(HttpServerConfig.apply) -case class ElasticConfig(uri: org.http4s.Uri) +case class ElasticConfig(uri: Uri) object ElasticConfig: private def uri = - env("ELASTIC_URI").or(prop("elastic.uri")).as[org.http4s.Uri].default(uri"http://127.0.0.1:9200") + env("ELASTIC_URI").or(prop("elastic.uri")).as[Uri].default(uri"http://127.0.0.1:9200") def config = uri.map(ElasticConfig.apply) diff --git a/modules/ingestor/src/main/scala/app.config.scala b/modules/ingestor/src/main/scala/app.config.scala index 27b7a2b..e50f851 100644 --- a/modules/ingestor/src/main/scala/app.config.scala +++ b/modules/ingestor/src/main/scala/app.config.scala @@ -5,6 +5,7 @@ import cats.effect.IO import cats.syntax.all.* import ciris.* import ciris.http4s.* +import org.http4s.Uri import org.http4s.implicits.* import java.time.Instant @@ -41,11 +42,11 @@ object MongoConfig: def config = (uri, name, studyUri, studyDatabase).parMapN(MongoConfig.apply) -case class ElasticConfig(uri: org.http4s.Uri) +case class ElasticConfig(uri: Uri) object ElasticConfig: private def uri = - env("ELASTIC_URI").or(prop("elastic.uri")).as[org.http4s.Uri].default(uri"http://127.0.0.1:9200") + env("ELASTIC_URI").or(prop("elastic.uri")).as[Uri].default(uri"http://127.0.0.1:9200") def config = uri.map(ElasticConfig.apply) case class IngestorConfig(