Fork me on GitHub
#ring
<
2020-04-07
>
EmmanuelOga06:04:53

sup, is there any nice middleware to serve a random folder that is not on resources/ of my project? Can't find it and been googling for a while

EmmanuelOga06:04:15

thinking something akin to python -m SimpleHTTPServer, which serves the folder where you run that command

EmmanuelOga07:04:55

weird, can't find anything

EmmanuelOga07:04:19

I'm using reitit, which includes something like I'm looking for but only for io/resources https://github.com/metosin/reitit/blob/master/doc/ring/static.md

EmmanuelOga07:04:36

seems like I'm gonna have to roll my own

EmmanuelOga07:04:19

hmmmm it seems like ring's wrap-file may be what I need. Despite the name, it seems like it also wraps directories

EmmanuelOga08:04:16

effectively: (-> my-handler (ring-file/wrap-file "/path")) is what I was looking for.

👍 4