summaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorDavid Barksdale <amatus@amatus.name>2016-11-25 10:46:06 -0600
committerDavid Barksdale <amatus@amatus.name>2016-11-25 15:45:17 -0600
commit53284a2f5d22d15cd7851fd0f06a53ea1df0c280 (patch)
treed9831c1d6f1187611b16fb2028e9ab9882dfc017 /src/app
parent475f9f3ac7688e58505690d420cafe6ae8bb8b5f (diff)
Starting point for hoplon app
Diffstat (limited to 'src/app')
-rw-r--r--src/app/core.clj8
-rw-r--r--src/app/handler.clj18
-rw-r--r--src/app/rpc.cljs6
3 files changed, 32 insertions, 0 deletions
diff --git a/src/app/core.clj b/src/app/core.clj
new file mode 100644
index 0000000..42ad0d1
--- /dev/null
+++ b/src/app/core.clj
@@ -0,0 +1,8 @@
+(ns app.core
+ (:gen-class)
+ (:require [app.handler :refer [app]]
+ [ring.adapter.jetty :refer [run-jetty]]))
+
+(defn -main
+ [& args]
+ (run-jetty app {:port 80}))
diff --git a/src/app/handler.clj b/src/app/handler.clj
new file mode 100644
index 0000000..eb0c2a3
--- /dev/null
+++ b/src/app/handler.clj
@@ -0,0 +1,18 @@
+(ns app.handler
+ (:require [castra.middleware :as castra]
+ [compojure.core :as c]
+ [compojure.route :as route]
+ [ring.middleware.defaults :as d]
+ [ring.util.response :as response]
+ [simpledb.core :as db]))
+
+(c/defroutes app-routes
+ (c/GET "/" req (response/content-type (response/resource-response "index.html") "text/html"))
+ (route/resources "/" {:root ""}))
+
+(def app
+ (-> app-routes
+ (castra/wrap-castra 'app.api)
+ (d/wrap-defaults d/api-defaults)))
+
+(db/init)
diff --git a/src/app/rpc.cljs b/src/app/rpc.cljs
new file mode 100644
index 0000000..7edbc4c
--- /dev/null
+++ b/src/app/rpc.cljs
@@ -0,0 +1,6 @@
+(ns app.rpc
+ (:require-macros
+ [javelin.core :refer [defc defc=]])
+ (:require
+ [javelin.core]
+ [castra.core :refer [mkremote]]))