'Ktor - Static content routing
I would love to understand better how Ktor is handling the routing for static content. I have the following hierarchy in my static folder (working directory):
- static
- index.html
- (some files)
- static
- css (directory)
- js (directory)
- (some files)
I'd like to serve all of them. So I was using directly this code in routing:
static {
defaultResource("index.html", "static")
resources("static")
}
Which works very well, but the issue is that it's taking the hand on all requests including my small get:
get("/smoketest"){
call.respondText("smoke test!", ContentType.Text.Plain)
}
What would be the best to handle in general the static content in Ktor?
Thank you
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
