             [frodo.web :refer [App]]))
 
 (defconfig app-config (io/resource "config.edn"))
+
+(defn is-dev? []
+  (= :dev (:env app-config)))
 
 (def login-form
   [:div {:class "row"}

    (friend/logout* (redirect (str (:context req) "/"))))
  (GET "/ping" [] (response "pong!"))
  (GET "/austin-connect-browser-repl.js" []
       (cemerick.austin.repls/browser-connected-repl-js))
  (route/resources "/user")
  (route/not-found "Not Found"))


                    :roles #{::user}}})



(defn init-cljs-repl []
  (def repl-env (reset! cemerick.austin.repls/browser-repl-env
                        (cemerick.austin/repl-env)))
  (pprint repl-env))

(comment
  (-> js/document .-body (.setAttribute "style" "background:white")))

(defn start-cljs-repl
  "this will start cljs repl inside clj repl
   which will work from cider only if server was started from same
   repl as they need to share repl-env var set session"[]
   (cemerick.austin.repls/cljs-repl hit-wl.handler/repl-env))

(defn init-middleware [handler]
  ;;dummy middleware handler to execute some init logic on app startup
  (db/init (get-db-config))
  (comment)
  (when (is-dev?)
    (init-cljs-repl))
  handler)

(def app
