what is wrong with this code? ```fun Application.d...
# ktor
c
what is wrong with this code?
Copy code
fun Application.download(iDownload: IShare) {
    routing {
        route("/download") {
            staticFiles(
                "/statics",
                File("files")
//                iDownload.downloadDir()
            )

            get("/apk") {
                call.respondFile(iDownload.myApk())
            }
        }
    }
}
url
/download/apk
is available, while
/download/statics
is 404. not found.
seems this is a bug
a
Which file's content should be returned for the
/download/statics
request?
c
should return an html page listing all files.
instead of 404
a
The
staticFiles
method doesn't render the file listings. It could return the content of a default file specified by the
index
argument.
c
🥶...
the return of 404 is not acceptable, because the folder exists, directories are files too.
the response should be OK and can be accompanied with a message like
Copy code
file indexing is not enabled.
a
Please leave a comment at https://youtrack.jetbrains.com/issue/KTOR-8115 with the description of the problem. Also, please explain why it's expected for
staticFiles
to return the file listing.