How do I serve folders (not files) using ktor? I w...
# ktor
a
How do I serve folders (not files) using ktor? I wan't to expose a certain directory that can be traversed in the browser via ktor. Solutions?
d
This sounds like what you need: https://ktor.io/samples/other/filelisting.html
j
With this I can serve all the files as static references. But you may want to list files. Is that your question?
a
I need what @diesieben07 suggests. But it seems like a lot of work for something so trivial
if I could serve a directory tree (with subfolders with files), that would help a bunch
@jorge.rego I tried that approach. It only seems to serve files, not folders with there subfolders. Any other decen way you know?
j
Nop, sorry. You can always encapsulate the file listing example that Take mentioned. Will take you 5 minutes defining a FileProvider to feed the route definition.