2021-02-15 12:15:16 +01:00
|
|
|
;; This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
;;
|
2021-04-10 09:43:04 +02:00
|
|
|
;; Copyright (c) UXBOX Labs SL
|
2021-02-15 12:15:16 +01:00
|
|
|
|
2020-06-29 16:07:48 +02:00
|
|
|
(ns app.config
|
|
|
|
(:require
|
|
|
|
["process" :as process]
|
|
|
|
[cljs.pprint]
|
|
|
|
[cuerdas.core :as str]))
|
|
|
|
|
|
|
|
(defn- keywordize
|
|
|
|
[s]
|
|
|
|
(-> (str/kebab s)
|
|
|
|
(str/keyword)))
|
|
|
|
|
|
|
|
(defonce env
|
|
|
|
(let [env (unchecked-get process "env")]
|
|
|
|
(persistent!
|
|
|
|
(reduce #(assoc! %1 (keywordize %2) (unchecked-get env %2))
|
|
|
|
(transient {})
|
|
|
|
(js/Object.keys env)))))
|
|
|
|
|
|
|
|
(defonce config
|
2021-01-28 16:27:18 +01:00
|
|
|
{:public-uri (:penpot-public-uri env "http://localhost:3449")})
|