Created
June 14, 2017 01:55
-
-
Save madstap/6224886af97f71528adadca2295a2183 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; In core.cljs | |
(ns foo.core | |
(:require | |
[pushy.core :as pushy] | |
[re-frame.core :as rf]])) | |
(defn routing! [] | |
(pushy/start! (pushy/pushy #(rf/dispatch [:routes/set-page %]) routes/match))) | |
(defn ^:export init [] | |
(rf/dispatch-sync [:initialize-db]) | |
(dev-setup) | |
(routing!) | |
(mount-root)) | |
;; In handler.clj | |
(ns foo.handler | |
(:require | |
[compojure.core :refer [ANY defroutes]] | |
[compojure.route :refer [resources]] | |
[ring.util.response :refer [resource-response]]])) | |
(defroutes routes | |
(ANY "*" [] (resource-response "index.html" {:root "public"})) | |
(resources "/")) | |
(def handler routes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment