first commit
This commit is contained in:
commit
5b16dd6774
24 files changed
+9575
No files matched your search
@@ -0,0 +1,38 @@
|
||||
(ns website.handler
|
||||
(:require [compojure.core :refer [GET defroutes]]
|
||||
[compojure.route :refer [not-found resources]]
|
||||
[hiccup.page :refer [include-js include-css html5]]
|
||||
[website.middleware :refer [wrap-middleware]]
|
||||
[config.core :refer [env]]))
|
||||
|
||||
(def mount-target
|
||||
[:div#app
|
||||
[:h3 "ClojureScript has not been compiled!"]
|
||||
[:p "please run "
|
||||
[:b "lein figwheel"]
|
||||
" in order to start the compiler"]])
|
||||
|
||||
(defn head []
|
||||
[:head
|
||||
[:title "Clojupyter"]
|
||||
[:meta {:charset "utf-8"}]
|
||||
[:meta {:name "viewport"
|
||||
:content "width=device-width, initial-scale=1"}]
|
||||
(include-css (if (env :dev) "/css/site.css" "/css/site.min.css"))])
|
||||
|
||||
(defn loading-page []
|
||||
(html5
|
||||
(head)
|
||||
[:body {:class "body-container"}
|
||||
mount-target
|
||||
(include-js "/js/app.js")]))
|
||||
|
||||
|
||||
(defroutes routes
|
||||
(GET "/" [] (loading-page))
|
||||
(GET "/about" [] (loading-page))
|
||||
|
||||
(resources "/")
|
||||
(not-found "Not Found"))
|
||||
|
||||
(def app (wrap-middleware #'routes))
|
||||
Reference in new issue
Block a user