Get rid of conf.js (not used anymore)

This commit is contained in:
Aleksandr Zhuravlev 2020-10-22 15:16:55 +03:00
parent e27d5c0213
commit bf3242a6f4

View file

@ -32,14 +32,10 @@
(create-swagger-ui-handler nil)) (create-swagger-ui-handler nil))
([options] ([options]
(let [config-json (fn [{:keys [url config]}] (j/write-value-as-string (merge config {:url url}))) (let [config-json (fn [{:keys [url config]}] (j/write-value-as-string (merge config {:url url})))
conf-js (fn [opts] (str "window.API_CONF = " (config-json opts) ";"))
options (as-> options $ options (as-> options $
(update $ :root (fnil identity "swagger-ui")) (update $ :root (fnil identity "swagger-ui"))
(update $ :url (fnil identity "/swagger.json")) (update $ :url (fnil identity "/swagger.json"))
(assoc $ :paths {"/conf.js" {:headers {"Content-Type" "application/javascript"} (assoc $ :paths {"/config.json" {:headers {"Content-Type" "application/json"}
:status 200
:body (conf-js $)}
"/config.json" {:headers {"Content-Type" "application/json"}
:status 200 :status 200
:body (config-json $)}}))] :body (config-json $)}}))]
(ring/routes (ring/routes