Skip to content

Commit

Permalink
Added support for baseUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetkhanduri committed Dec 16, 2022
1 parent 5902867 commit d3c97ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/main/scala/ai/diffy/ApiController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ class ApiController(
@GetMapping(path = Array("/api/1/info"))
def getInfo(): Map[String, _] = Map(
"name" -> settings.serviceName,
"candidate" -> httpServiceToMap(s"${settings.candidateHost}:${settings.candidatePort}"),
"primary" -> httpServiceToMap(s"${settings.primaryHost}:${settings.primaryPort}"),
"secondary" -> httpServiceToMap(s"${settings.secondaryHost}:${settings.secondaryPort}"),
"candidate" -> httpServiceToMap(settings.candidate.toString),
"primary" -> httpServiceToMap(settings.primary.toString),
"secondary" -> httpServiceToMap(settings.secondary.toString),
"relativeThreshold" -> settings.relativeThreshold,
"absoluteThreshold" -> settings.absoluteThreshold,
"protocol" -> "http",
Expand Down
8 changes: 6 additions & 2 deletions src/main/scala/ai/diffy/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,9 @@ object Downstream {
}
}
sealed trait Downstream
case class HostPort(host: String, port: Int) extends Downstream
case class BaseUrl(baseUrl: String) extends Downstream
case class HostPort(host: String, port: Int) extends Downstream{
override def toString: String = s"${host}:${port}"
}
case class BaseUrl(baseUrl: String) extends Downstream {
override def toString: String = baseUrl
}

0 comments on commit d3c97ab

Please sign in to comment.