Skip to content

Instantly share code, notes, and snippets.

@madstap
Created June 14, 2017 01:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save madstap/6224886af97f71528adadca2295a2183 to your computer and use it in GitHub Desktop.
Save madstap/6224886af97f71528adadca2295a2183 to your computer and use it in GitHub Desktop.
;; 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