Skip to content

Commit

Permalink
Fix not concatenated routes
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolajkapica committed Jun 22, 2024
1 parent 84e9407 commit 84fcc42
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions api/src/main/scala/Router.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,27 @@ import akka.http.scaladsl.model.HttpEntity
import akka.http.scaladsl.server.Directives.complete
import akka.http.scaladsl.server.Directives.get
import akka.http.scaladsl.server.Directives.path
import akka.http.scaladsl.server.Directives.pathSingleSlash
import akka.http.scaladsl.server.Route
import akka.http.scaladsl.server.Directives._enhanceRouteWithConcatenation

object Router {

val route: Route =
path("hello") {
pathSingleSlash {
get {
complete(HttpEntity(ContentTypes.`text/html(UTF-8)`, "<h1>Say hello to akka-http</h1>"))
complete(HttpEntity(ContentTypes.`text/html(UTF-8)`, "<h1>Welcome to the API</h1>"))
}
}
path("health") {
get {
complete(HttpEntity(ContentTypes.`text/html(UTF-8)`, "<h1>OK</h1>"))
} ~
path("hello") {
get {
complete(HttpEntity(ContentTypes.`text/html(UTF-8)`, "<h1>Say hello to akka-http</h1>"))
}
} ~
path("health") {
get {
complete(HttpEntity(ContentTypes.`text/html(UTF-8)`, "<h1>OK</h1>"))
}
}
}

}

0 comments on commit 84fcc42

Please sign in to comment.