Hi! Something shady is going on while trying to us...
# ktor
e
Hi! Something shady is going on while trying to use Static Content. This is my code:
Copy code
static("assets") {
    staticRootFolder = File("public")
    files("static")
}
The problem is that files are not resolved correctly. For instance, when I call /assets/static/file.txt on the server, I can see while debugging that in
StaticContent.kt#L86
, the file is resolved to
public/static/static/file.txt
instead of
public/static/file.txt
as I would expect. Pretty much the folder name is duplicated. Any idea what might be wrong, or wether this could be a bug in Ktor?
For anyone running into the same issue, I realised that the mistake was on my part. This is the correct setup:
Copy code
static("assets") {
            staticRootFolder = File("public")
            static("static") {
                files("static")
            }
        }