我使用Leiningen有以下目錄結構的小Clojure的項目工作Acessing資源文件:Clojure中webnoir項目
- project
- src
- test
- xxx
- login.clj
- resources
- public
- css
- bootstrap.css
在test目錄下的文件login.clj,我試圖發出聲音在respuces /公共區域/ CSS目錄中的文件bootstrap.css:
(def css-file "/css/bootstrap.css")
(def css-contents (slurp css-file))
它返回找不到文件的錯誤:
Exception in thread "main" java.io.FileNotFoundException: /css/bootstrap.css (No such file or directory), compiling:(login.clj:10)
所以問題很簡單,我應該怎麼做才能訪問文件?
謝謝!有效。 – r0hitsharma