 (ns barmap.web
   (:use [compojure.core]
         [ring.util.response]
-        [ring.middleware.format-response])
+        [ring.middleware.format-response]
+        [hiccup.core])
   (:require
     [compojure.handler :as handler]
     [compojure.route :as route]

           wrap-error-page
           trace/wrap-stacktrace))
        (wrap-restful-response)
          (handler/site {:session {:store store}}))))

(defn -main [& [port]]
  (let [port (Integer. (or port (env :port) 5000))]


(defroutes app
           apiController/routes
           (ANY "/repl" {:as req}
                (drawbridge req))
           (GET "/" []
                (html
                  [:html5
                   [:body [:div#content
                           [:ul#locationList
                            (for [bar (places/all)]
                              [:li (:name bar)])]]]]))
           (ANY "*" []
                (route/not-found (slurp (io/resource "404.html")))))

(defn wrap-app [app]
  ;; TODO: heroku config:add SESSION_SECRET=$RANDOM_16_CHARS
