# Serve files

**URL:** <https://discourse.julialang.org/t/serve-files/35229>\
**Category:** General Usage\
**Tags:** question, webapps\
**Created:** [February 27, 2020, 1:09pm UTC](https://discourse.julialang.org/t/serve-files/35229 "2020-02-27T13:09:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [February 27, 2020, 1:09pm UTC](https://discourse.julialang.org/t/serve-files/35229/1 "2020-02-27T13:09:51Z")

</div>

How can I serve the content of a specific folder online?  
Something like this:

 ![Screenshot from 2020-02-27 14-07-10](https://global.discourse-cdn.com/julialang/original/3X/1/0/103a2911c8fee13542e03227dd17a382f47aa6fe.png)  
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](https://discourse.julialang.org/t/a-simple-http-server-for-showing-files-in-browser/6561) about this topic was more than 2 years ago so I figured I’ll ask anew.

Thanks!

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [February 28, 2020, 2:48pm UTC](https://discourse.julialang.org/t/serve-files/35229/2 "2020-02-28T14:48:51Z")

</div>

Simon helped me with the following example for how to accomplish this using `JSServe` and `AssetRegistry`:

```julia
using JSServe, AssetRegistry

function create_link(parent, file)
    url = AssetRegistry.register(joinpath(parent, file))
    return JSServe.DOM.a(href=url, file)
end

function test_handler(session, req)
    path = pwd()

    dom = JSServe.DOM.div([JSServe.DOM.div(create_link(path, file)) for file in readdir(path)]...)

    return JSServe.DOM.div(dom)
end

app = JSServe.Application(test_handler, "0.0.0.0", 8081)

```
