How can I serve the content of a specific folder online?
Something like this:
The goal is for a user to see a list of all the available files in that folder and be able to download them. The last post
about this topic was more than 2 years ago so I figured I’ll ask anew.
Simon helped me with the following example for how to accomplish this using
using JSServe, AssetRegistry
function create_link(parent, file)
url = AssetRegistry.register(joinpath(parent, file))
return JSServe.DOM.a(href=url, file)
function test_handler(session, req)
path = pwd()
dom = JSServe.DOM.div([JSServe.DOM.div(create_link(path, file)) for file in readdir(path)]...)
app = JSServe.Application(test_handler, "0.0.0.0", 8081)