Boot: serves for non-root directory from path class in cljs reload handler

I tried to convert leiningen project for download: https://github.com/borkdude/lein2boot .

It uses the serve task to serve the handler. The handler offers APIs as well as files. Using the reload task I want to be able to reload the javascript.

I needed to put the html and javascript in the root of the resource directory ("assets" in this example) because the reload task sends the modified javascript to the browser using the full resource path ( /main.js

). This means that I also have to serve as the root of my (resources "/" {:root ""})

classpath : in Compojure. The problem is that anyone can request any file from my entire classpath: no good.

When I port the javascript to assets/public/main.js

and serve from the shared directory: the (resources "/" {:root "public"})

file can be requested from "/main.js" but the reload task notifies the browser to reload the file from "/public/main.js" which raises a 404.

How can I solve this problem?

+3


source to share


1 answer


This appears to work at https://github.com/adzerk-oss/boot-reload/issues/18 , but will eventually allow the option to :asset-path

provide relative roots.



+1


source







All Articles