Alex Styl
12/08/2021, 6:56 PMfun Application.configureRouting() {
routing {
static("/vid") {
files("videos")
}
get("/download/*") {
val file = File("./files/hello.txt")
call.respondFile(file)
}
get("/") {
call.respondHtml {
body {
a(href = "/download/hello.txt") {
attributes["download"] = ""
+"Download"
}
video {
loop = true
controls = true
source {
src = "/vid/vid.mp4"
type = "video/mp4"
}
}
}
}
}
}
}
Aleksei Tirman [JB]
12/09/2021, 8:23 AMhello.txt
can be downloaded without problems.Alex Styl
12/09/2021, 9:06 AM