summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/app/api.clj4
-rw-r--r--src/app/handler.clj6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/app/api.clj b/src/app/api.clj
index 0f7ab17..f3a4324 100644
--- a/src/app/api.clj
+++ b/src/app/api.clj
@@ -1,6 +1,4 @@
(ns app.api
(:require [castra.core :refer [defrpc]]))
-(defrpc get-state []
- {:inputs []
- :outputs []})
+(defrpc get-state [])
diff --git a/src/app/handler.clj b/src/app/handler.clj
index fdf722e..21d52ab 100644
--- a/src/app/handler.clj
+++ b/src/app/handler.clj
@@ -12,9 +12,13 @@
(c/GET "/" req (response/content-type (response/resource-response "index.html") "text/html"))
(route/resources "/" {:root ""}))
+(defn state-fn []
+ {:temps @temp/temp
+ :pm (select-keys @pm/pm [:status :current])})
+
(def app
(-> app-routes
- (castra/wrap-castra {:state-fn (fn [] "ohi")} 'app.api)
+ (castra/wrap-castra {:state-fn state-fn} 'app.api)
(d/wrap-defaults d/api-defaults)))
(db/init)