Open oubiwann opened 8 years ago
This seems awfully web-server-dependent and I'm not sure a general solution makes much sense.
Yeah, definitely web-server-dependent ... the ultimate goal for lmug apps is to be portable between web servers. So it makes sense to explore the boundaries of that goal. Maybe we won't be able to do this in a way that is web-server-agnostic -- but maybe we will!
Ring supports this feature -- I think it would be good to explore, at the very least.
Let's make a list of how the various web servers do it. I can handle elli and cowboy if you wanna do yaws and inlets.
Most of the work for this is already done as part of the first draft in #7. Note: that implementation doesn't worry about underlying HTTP servers, so the concerns noted above don't apply.
All that's left to do for this middleware (after acceptance testing is complete on #7) is to special-case the functionalty for a single file and create the tiny mw wrapper for it.
See https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/file.clj