ring

EmmanuelOga 2020-04-07T06:37:53.020400Z

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

EmmanuelOga 2020-04-07T06:38:15.020900Z

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

EmmanuelOga 2020-04-07T07:49:55.021100Z

weird, can't find anything

EmmanuelOga 2020-04-07T07:50:19.021700Z

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

EmmanuelOga 2020-04-07T07:50:36.022200Z

seems like I'm gonna have to roll my own

EmmanuelOga 2020-04-07T07:55:19.022700Z

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

EmmanuelOga 2020-04-07T08:38:16.023500Z

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

👍 1