I’m not sure I’d blame lein ring just yet. :) All that’s doing is bootstrapping the application.
I’m not sure why the issue surfaces on windows specifically. All that’s happening in noir.io is that it generates the path string relative to the public folder.
The implementation is very simple, you can see what’s happening here.
It grabs the resource URL
(io/resource (str "public" File/separator)) and its path, then appends the relative path and the filename:
(str (resource-path) relative-path File/separator filename)
It could be that windows is having a problem with the utf-8 path string.
In the latest version (0.7.5), it’s been updated to simply use the file path supplied without prepending the public folder path. So, that should address the jar problem at least.
I’ve updated the code in the latest draft to work with that. Since the path is now pointing to the filesystem, we need an extra route to read the file from there:
(def galleries "galleries")
(defn serve-file [user-id file-name]
(file-response (str galleries File/separator user-id File/separator file-name)))
(GET "/img/:user-id/:file-name" [user-id file-name]
(serve-file user-id file-name))
If you could try to try and see if this approach works for you, I’d be interested to know.