     (Integer/parseInt (System/getenv "HTTP_PORT"))
     8080))
 
-(defn start [sensa-fns]
-  (def server (httpkit/run-server (-> (app sensa-fns)
+(defn start [senta-state]
+  (def server (httpkit/run-server (-> (app senta-state)
                                       (logging-middleware)
                                       (site)
                                       (stefon/asset-pipeline pc.stefon/stefon-options))


(defn restart []
  (stop)
  (start @sensa-fns))

(defn sensa-init []
  (let [{:keys [ch-recv send-fn ajax-post-fn connected-uids
                ajax-get-or-ws-handshake-fn] :as fns} (sente/make-channel-socket! {})]
    (reset! sensa-fns fns)))

(defn init []
  (sensa-init)
  (start @sensa-fns))

(ns pc.server
  (:require [clojure.core.async :as async]
            [clojure.tools.logging :as log]
            [clojure.tools.reader.edn :as edn]
            [clj-time.core :as time]
            [compojure.core :refer (defroutes routes GET POST ANY)]
