mirror of
https://github.com/penpot/penpot.git
synced 2025-08-06 13:28:32 +02:00
✨ Improve public-uri handling
This enables use penpot under subdirectory
This commit is contained in:
parent
ee1058950e
commit
a1fccd46ff
16 changed files with 73 additions and 58 deletions
|
@ -6,17 +6,24 @@
|
|||
|
||||
(ns app.main.worker
|
||||
(:require
|
||||
[app.config :as cfg]
|
||||
[app.config :as cf]
|
||||
[app.main.errors :as err]
|
||||
[app.util.worker :as uw]))
|
||||
|
||||
(defonce instance (atom nil))
|
||||
|
||||
(defn- update-public-uri!
|
||||
[instance val]
|
||||
(uw/ask! instance {:cmd :configure
|
||||
:key :public-uri
|
||||
:val val}))
|
||||
|
||||
(defn init!
|
||||
[]
|
||||
(reset!
|
||||
instance
|
||||
(uw/init cfg/worker-uri err/on-error)))
|
||||
(let [worker (uw/init cf/worker-uri err/on-error)]
|
||||
(update-public-uri! worker @cf/public-uri)
|
||||
(add-watch cf/public-uri ::worker-public-uri (fn [_ _ _ val] (update-public-uri! worker val)))
|
||||
(reset! instance worker)))
|
||||
|
||||
(defn ask!
|
||||
[message]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue