How can I solve issue of missing static content when serving html from Spray (or Akka-Http) ? Base url of my service is /api (even though it should be irrelevant in this case).
Here is my route
get {
pathPrefix("swagger") {
pathEndOrSingleSlash {
getFromResource("swagger-ui/index.html")
} ~
getFromResourceDirectory("swagger-ui")
}
}Loaded html can find css and js file when I open it as
/api/swagger/
but when I open
/api/swagger (without trailing slash)
loaded html attempts to get content from
/api/css/reset.css instead of /api/swagger/css/reset.css
How should I rewrite my route to cover both cases ?
Thanks!