Skip to content

Commit

Permalink
Merge pull request #2192 from filipesilva/server-web-client
Browse files Browse the repository at this point in the history
feat: serve web client from athens server
  • Loading branch information
filipesilva authored May 24, 2022
2 parents 3c8cdbc + 5a0bc15 commit 25338bf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ jobs:
- uses: actions/checkout@v2
- uses: ./.github/custom-actions/clojure-env

- name: Download built app
uses: actions/download-artifact@v2
with:
name: app
path: resources

- name: Compile server code
run: yarn server:compile

Expand Down
3 changes: 2 additions & 1 deletion deps.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{:paths ["src/clj" "src/cljs" "src/cljc" "src/js" "src/gen" "test"]
{:paths ["src/clj" "src/cljs" "src/cljc" "src/js" "src/gen" "test" "resources"]

:deps
{org.clojure/clojure #:mvn{:version "1.11.1"}
Expand Down Expand Up @@ -40,6 +40,7 @@
;; web server
http-kit/http-kit #:mvn{:version "2.5.3"}
compojure/compojure #:mvn{:version "1.6.2"}
ring/ring-core #:mvn{:version "1.9.5"}
;; data validation
metosin/malli #:mvn{:version "0.5.1"}
;; networked repl
Expand Down
12 changes: 10 additions & 2 deletions src/clj/athens/self_hosted/components/web.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
[athens.self-hosted.web.presence :as presence]
[com.stuartsierra.component :as component]
[compojure.core :as compojure]
[org.httpkit.server :as http]))
[org.httpkit.server :as http]
[ring.middleware.resource :as ring.resource]
[ring.util.response :as ring.response]))


;; WebSocket handlers
Expand Down Expand Up @@ -118,9 +120,15 @@
:body "ok"}))


(compojure/defroutes web-client
(-> (compojure/GET "/" [] (ring.response/resource-response "public/index.html"))
(ring.resource/wrap-resource "public")))


(defn make-handler
[datascript fluree config]
(compojure/routes health-check-route
(compojure/routes web-client
health-check-route
(make-ws-route datascript fluree config)))


Expand Down

0 comments on commit 25338bf

Please sign in to comment.