I’m thinking about simplifying static files/resour...
# ktor
o
I’m thinking about simplifying static files/resources serving. What do you think about the following DSL?
Copy code
static("/path") {
   default("index.html") // empty path serves index.html
   default("subdir", "index.html") // /path/subdir path serves index.html
   
   file("foo.txt") // serve foo.txt at /path/foo.txt
   file("bar.txt", "foo.txt") //serve foot.txt at /path/bar.txt
   files("local/file/path") // maps files from local/file/path/* to /path/*
   files("local", "local/file/path") // maps files from local/file/path/* to /path/local/*
   
   resource(…) // same, but for embedded resources
}