🎉 Make the build to be config independent.

Loading the configuration dinamically using
global variables defined in index.html.
This commit is contained in:
Andrey Antukh 2020-03-11 09:20:12 +01:00
parent 1ce46a0ef8
commit c09f281f58
6 changed files with 38 additions and 21 deletions

View file

@ -2,10 +2,15 @@
;; 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/.
;;
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2016-2020 Andrey Antukh <niwi@niwi.nz>
(ns uxbox.config)
(ns uxbox.config
(:require [goog.object :as gobj]))
(goog-define url "")
(goog-define demo-warning false)
(goog-define default-language "en")
(let [config (gobj/get goog.global "uxboxConfig")]
(def default-language "en")
(def url (gobj/get config "apiUrl" "http://localhost:6060/"))
(def demo-warning (gobj/get config "demoWarning" true)))