Open cindywu opened 3 years ago
It looks like you might have an older version of the template. Might be worth checking if you have a specific version pinned in your ~/.lein/profiles.clj
, and you could clear the local maven cache for the template by removing the ~/.m2/repository/luminus/lein-template/
folder.
The latest version of the template should be generating the following content for new-project.routes.home
:
(ns new-project.routes.home
(:require
[new-project.layout :as layout]
[clojure.java.io :as io]
[new-project.middleware :as middleware]
[ring.util.response]
[ring.util.http-response :as response]))
(defn home-page [request]
(layout/render request "home.html"))
(defn home-routes []
[""
{:middleware [middleware/wrap-csrf
middleware/wrap-formats]}
["/" {:get home-page}]
["/docs" {:get (fn [_]
(-> (response/ok (-> "docs/docs.md" io/resource slurp))
(response/header "Content-Type" "text/plain; charset=utf-8")))}]])
Creating a new luminus project using
lein new luminus new-project +cljs
produces a bug in thenew-project.routes.home
namespace.When the user runs
lein run
they will get this error:To resolve the error, go into
new-project.routes.home
and make the following change:Change
ok
toresponse/ok
.I am pretty new to Clojure(Script), but if someone points me in the right direction I can try and fix and submit a PR.