diff --git a/deps.edn b/deps.edn index cc4ad33b..71b35343 100644 --- a/deps.edn +++ b/deps.edn @@ -12,6 +12,7 @@ [cljsjs/oidc-client reagent/reagent re-frame/re-frame]} + com.yetanalytics/re-route {:mvn/version "0.1.0"} com.yetanalytics/xapi-schema {:mvn/version "1.2.3"} com.fasterxml.jackson.core/jackson-core {:mvn/version "2.11.4"} com.fasterxml.jackson.dataformat/jackson-dataformat-smile @@ -37,6 +38,8 @@ :build {:main-opts ["-m" "figwheel.main" "-b" "dev" "-r"]} :min {:main-opts ["-m" "figwheel.main" "-O" "advanced" "-bo" "dev"]} :test {:main-opts ["-m" "figwheel.main" "-co" "test.cljs.edn" "-m" "com.yetanalytics.lrs-admin-ui.test-runner"]} - :dev {:extra-deps + :dev {:extra-paths + ["dev"] + :extra-deps {day8.re-frame/tracing {:mvn/version "0.6.2"} day8.re-frame/re-frame-10x {:mvn/version "1.2.2"}}}}} diff --git a/dev.cljs.edn b/dev.cljs.edn index 3d0bd37a..645724cc 100644 --- a/dev.cljs.edn +++ b/dev.cljs.edn @@ -1,7 +1,9 @@ ^{:watch-dirs ["src" "test"] :css-dirs ["resources/public/css"] :auto-testing true - :auto-bundle :webpack} + :auto-bundle :webpack + :ring-handler com.yetanalytics.lrs-admin-ui.server/handler + :open-url "http://[[server-hostname]]:[[server-port]]/admin/ui"} {:main com.yetanalytics.lrs-admin-ui.core :closure-defines {"re_frame.trace.trace_enabled_QMARK_" true} :preloads [day8.re-frame-10x.preload]} diff --git a/dev/com/yetanalytics/lrs_admin_ui/server.clj b/dev/com/yetanalytics/lrs_admin_ui/server.clj new file mode 100644 index 00000000..ca273791 --- /dev/null +++ b/dev/com/yetanalytics/lrs_admin_ui/server.clj @@ -0,0 +1,18 @@ +(ns com.yetanalytics.lrs-admin-ui.server + "Ring handler only for dev/figwheel to serve multiple paths" + (:require [ring.util.request :as req] + [ring.util.response :as resp])) + +(defn handler [request] + (cond + (not= :get (:request-method request)) + {:status 405 + :headers {"Context-Type" "text/plain"} + :body "Unsupported Operation!"} + ;; Imitate backend redirects + ;; NOTE: "/" will actually not get redirected since Figwheel handles + ;; that separately. + (#{"/" "/admin" "/admin/"} (req/path-info request)) + (resp/redirect "/admin/ui") + :else + (resp/file-response "resources/public/"))) diff --git a/resources/public/index.html b/resources/public/index.html index b7424529..aaf1983f 100644 --- a/resources/public/index.html +++ b/resources/public/index.html @@ -3,18 +3,18 @@ - - - - + + + + Yet Analytics LRS - - + +
- + +