Add simple static file server
This commit is contained in:
parent
0043cb6a14
commit
5241cae418
4 changed files with 30 additions and 848 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
|||
report.html
|
||||
|
||||
# Created by https://www.gitignore.io/api/clojure,emacs
|
||||
# Edit at https://www.gitignore.io/?templates=clojure,emacs
|
||||
|
|
|
|||
7
deps.edn
7
deps.edn
|
|
@ -1,4 +1,7 @@
|
|||
{:paths ["src"]
|
||||
{:paths ["src" "resources"]
|
||||
:deps {thheller/shadow-cljs {:mvn/version "2.8.109"}
|
||||
appliedscience/js-interop {:mvn/version "0.2.5"}
|
||||
reagent {:mvn/version "1.0.0-alpha1"}}}
|
||||
reagent {:mvn/version "1.0.0-alpha1"}
|
||||
|
||||
http-kit {:mvn/version "2.3.0"}
|
||||
compojure {:mvn/version "1.6.1"}}}
|
||||
|
|
|
|||
846
report.html
846
report.html
File diff suppressed because one or more lines are too long
24
src/heyarne/all_my_friends/server.clj
Normal file
24
src/heyarne/all_my_friends/server.clj
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
(ns heyarne.all-my-friends.server
|
||||
(:require [org.httpkit.server :as http]
|
||||
[compojure.core :as router]
|
||||
[compojure.route :as route])
|
||||
#_(:gen-class))
|
||||
|
||||
(router/defroutes app
|
||||
#_(router/GET "/" []
|
||||
{:status 200
|
||||
:body "Hello world"})
|
||||
(route/files "/")
|
||||
(route/not-found "Not found."))
|
||||
|
||||
(defonce server (atom nil))
|
||||
|
||||
(defn stop-server []
|
||||
(when-not (nil? @server)
|
||||
(@server :timeout 100)
|
||||
(reset! server nil)))
|
||||
|
||||
(defn -main [& args]
|
||||
(reset! server (http/run-server #'app {:port 8081})))
|
||||
|
||||
#_(-main)
|
||||
Loading…
Add table
Add a link
Reference in a new issue