I try to use the Route.static function to serve static files, but it doesn't work. I have tried all kinds of combinations and folders in my working directory. Now I have a css under resources/static/css, and index.html under resources/static. If I write the following I don't get served anything :
@kotlin.jvm.JvmOverloads
fun Application.module(testing: Boolean = false) {
val client = HttpClient(Apache) {}
routing {
static("root") {
files("css")
default("index.html")
}
}
}
I can however, from this answer : Ktor - Static content routing, write :
resource("/", "index.html")
resource("*", "index.html")
Then I will get index.html under resources/static. I cannot however get anything else. What am I doing wrong here ?
Ref : https://ktor.io/servers/features/static-content.html#specifying-files-and-folders