Do not set default instance

This commit is contained in:
arne 2023-10-06 19:30:13 +02:00
commit 51b7139e80

View file

@ -78,16 +78,18 @@
[::xspf/location (:url file)]])) statuses)]]))
(defn app [req]
(let [instance-url (if (not= "/" (:uri req))
(str "https://"
(if (= "/" (:uri req))
{:status 400
:headers {"Content-Type" "text/plain"}
:body "Please use the path to set an instance URL, for example /merveilles.town.xspf."}
(let [instance-url (str "https://"
(-> (str/replace (:uri req) #"^/" "")
(str/replace #".xspf$" "")))
"https://post.lurk.org")
token (some-> (:body req) (slurp) (json/parse-string true) :token)
statuses (fetch-loops instance-url token)]
{:status 200
:headers {"Content-Type" "application/xspf+xml"}
:body (xml/indent-str (->xspf statuses))}))
:body (xml/indent-str (->xspf statuses))})))
(defonce server
(atom nil))