Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Add base url #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ zk-web is also easy to configurate. It reads `$HOME/.zk-web-conf.clj` or `conf/z
;; you can add more
}
:default-node "localhost:2181/my-start-node" ;; optional
:base-url "/prefix" ;; optional
}
```

Expand All @@ -55,6 +56,7 @@ zk-web is also easy to configurate. It reads `$HOME/.zk-web-conf.clj` or `conf/z
* @lra
* @lispmind
* @killme2008
* @thorhs


## License
Expand Down
3 changes: 2 additions & 1 deletion conf/zk-web-conf.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
:server-port 8080
:users {"admin" "hello"}
:default-node ""
}
:base-uri "/"
}
6 changes: 4 additions & 2 deletions src/zk_web/server.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

(defn -main [& m]
(let [mode (keyword (or (first m) :dev))
port (:server-port (conf/load-conf))]
port (:server-port (conf/load-conf))
base-url (:base-url (conf/load-conf))]
(server/start port {:mode mode
:ns 'zk-web})))
:ns 'zk-web
:base-url base-url})))