cleaned up shit.
This commit is contained in:
1 parent
56fcacc2d8
commit
e3dcba6c37
3 files changed
+10
-47
No files matched your search
Vendored
-33
@@ -1,33 +0,0 @@
|
||||
(ns skirmish.wui.repl
|
||||
(:use skirmish.wui.handler
|
||||
figwheel-sidecar.repl-api
|
||||
ring.server.standalone
|
||||
[ring.middleware file-info file]))
|
||||
|
||||
(defonce server (atom nil))
|
||||
|
||||
(defn get-handler []
|
||||
;; #'app expands to (var app) so that when we reload our code,
|
||||
;; the server is forced to re-resolve the symbol in the var
|
||||
;; rather than having its own copy. When the root binding
|
||||
;; changes, the server picks it up without having to restart.
|
||||
(-> #'app
|
||||
; Makes static assets in $PROJECT_DIR/resources/public/ available.
|
||||
(wrap-file "resources")
|
||||
; Content-Type, Content-Length, and Last Modified headers for files in body
|
||||
(wrap-file-info)))
|
||||
|
||||
(defn start-server
|
||||
"used for starting the server in development mode from REPL"
|
||||
[& [port]]
|
||||
(let [port (if port (Integer/parseInt port) 3000)]
|
||||
(reset! server
|
||||
(serve (get-handler)
|
||||
{:port port
|
||||
:auto-reload? true
|
||||
:join? false}))
|
||||
(println (str "You can view the site at http://localhost:" port))))
|
||||
|
||||
(defn stop-server []
|
||||
(.stop @server)
|
||||
(reset! server nil))
|
||||
Reference in new issue
Block a user