(ns braid.base.conf
  (:require
   [braid.base.conf-extra :refer [ports-config]]
   [braid.core.hooks :as hooks]
   [mount.core :as mount :refer [defstate]]))

(defonce config-vars
  (hooks/register! (atom []) [keyword?]))

(defstate config
  :start
  (merge ;; temp defaults
    ;; TODO don't special case these here
    ;; ports should come from config
    {:db-url "datomic:mem://braid"
     :api-domain (str "localhost:" (:port (mount/args)))
     :site-url (str "http://localhost:" (:port (mount/args)))
     :hmac-secret "secret"}
    @ports-config ; overrides api-domain & site url when port is automatically found
    (select-keys (mount/args) @config-vars)))

(ns braid.base.conf
  (:require
   [braid.base.conf-extra :refer [ports-config]]
   [braid.core.hooks :as hooks]
   [mount.core :as mount :refer [defstate]]))

(defonce config-vars
  (hooks/register! (atom []) [keyword?]))

(defstate config
  :start
  (merge ;; temp defaults
    ;; TODO don't special case these here
    ;; ports should come from config
    {:db-url "datomic:mem://braid"
     :api-domain (str "localhost:" (inc (:port (mount/args))))
     :site-url (str "http://localhost:" (:port (mount/args)))
     :hmac-secret "secret"}
    @ports-config ; overrides api-domain & site url when port is automatically found
    (select-keys (mount/args) @config-vars)))

Fix api port number after removing mobile server
Fix api port number after removing mobile server


braidchat/braid,braidchat/braid,rafd/braid,rafd/braid