Add a function to get the SECRET enviroment variable.
This commit is contained in:
@@ -7,6 +7,15 @@
|
|||||||
(.-PORT))
|
(.-PORT))
|
||||||
"3000"))
|
"3000"))
|
||||||
|
|
||||||
|
(defn get-secret
|
||||||
|
"Gets the environment variable SECRET. If no variable, then the server will be crashed."
|
||||||
|
[]
|
||||||
|
(or (-> (.-env js/process)
|
||||||
|
(.-SECRET))
|
||||||
|
(do
|
||||||
|
(js/console.log "[ERROR] Set enviroment variable SECRET!!!")
|
||||||
|
(js/process.exit 1))))
|
||||||
|
|
||||||
(defn get-database-credentials
|
(defn get-database-credentials
|
||||||
"Gets the postgres credentials. Defaults: host - postgres, port - 5432, database - postgres, user - postgres, password - 'changeme!!!'."
|
"Gets the postgres credentials. Defaults: host - postgres, port - 5432, database - postgres, user - postgres, password - 'changeme!!!'."
|
||||||
[]
|
[]
|
||||||
|
|||||||
Reference in New Issue
Block a user