diff options
Diffstat (limited to 'src/clj/nicktodo/routes/home.clj')
-rw-r--r-- | src/clj/nicktodo/routes/home.clj | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/clj/nicktodo/routes/home.clj b/src/clj/nicktodo/routes/home.clj new file mode 100644 index 0000000..81062db --- /dev/null +++ b/src/clj/nicktodo/routes/home.clj @@ -0,0 +1,21 @@ +(ns nicktodo.routes.home + (:require + [nicktodo.layout :as layout] + [clojure.java.io :as io] + [nicktodo.middleware :as middleware] + [ring.util.response] + [ring.util.http-response :as response])) + +(defn home-page [request] + (layout/render request "home.html" {:docs (-> "docs/docs.md" io/resource slurp)})) + +(defn about-page [request] + (layout/render request "about.html")) + +(defn home-routes [] + [ "" + {:middleware [middleware/wrap-csrf + middleware/wrap-formats]} + ["/" {:get home-page}] + ["/about" {:get about-page}]]) + |