-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7137ddf
commit 088af3d
Showing
8 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ pom.xml.asc | |
.hgignore | ||
.hg/ | ||
.calva/ | ||
.clj-kondo/ | ||
**/.clj-kondo/.cache/ | ||
.lsp/ | ||
target/ | ||
node_modules/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{:lint-as {mount.core/defstate clojure.core/def}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.clj-kondo/ | ||
.clj-kondo/.cache | ||
.lsp/ | ||
target/ | ||
resources/public/js | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{:fhir-server-base-url #or [#env FHIR_SERVER_BASE_URL "http://localhost:8090/fhir"] | ||
:http-port #long #or [#env HTTP_PORT 8080]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(ns clinic.config | ||
(:refer-clojure :exclude [read]) | ||
(:require [aero.core :as aero] | ||
[clojure.java.io :as io] | ||
[mount.core :refer [defstate]])) | ||
|
||
(defstate ^:private config | ||
:start (-> "config.edn" | ||
(io/resource) | ||
(aero/read-config)) | ||
:stop nil) | ||
|
||
(defn read [key] | ||
(get config key)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
(ns clinic.core) | ||
(ns clinic.core | ||
(:require [clinic.config :as config] | ||
[mount.core :as mount])) | ||
|
||
(defn -main [] | ||
(prn "Hello, world!")) | ||
(mount/start) | ||
(prn (config/read :fhir-server-base-url) (config/read :http-port))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(ns clj.clinic.config-test | ||
(:require [clojure.test :refer [deftest is]] | ||
[aero.core :as aero] | ||
[clinic.config :as config] | ||
[mount.core :as mount])) | ||
|
||
(deftest read-test | ||
(with-redefs [aero/read-config (constantly {:test-key "test-val"})] | ||
(mount/start #'config/config) | ||
(is (= "test-val" (config/read :test-key))))) |