diff --git a/src/main/lrsql/admin/interceptors/ui.clj b/src/main/lrsql/admin/interceptors/ui.clj index ac35a605..ab968785 100644 --- a/src/main/lrsql/admin/interceptors/ui.clj +++ b/src/main/lrsql/admin/interceptors/ui.clj @@ -6,13 +6,13 @@ [lrsql.init.localization :refer [custom-language-map]])) (defn get-spa - [path-prefix] - (fn [_] - (-> (resp/resource-response (str path-prefix "public/admin/index.html")) - (assoc-in [:headers "Content-Type"] "text/html")))) + "Handler function that returns the index.html file." + [_] + (-> (resp/resource-response "public/admin/index.html") + (assoc-in [:headers "Content-Type"] "text/html"))) (defn admin-ui-redirect - "Handler function to redirect to the admin ui" + "Handler function to redirect to the admin UI." [path-prefix] (fn [_] (resp/redirect (str path-prefix "/admin/ui")))) diff --git a/src/main/lrsql/admin/routes.clj b/src/main/lrsql/admin/routes.clj index c439400a..8875e9d6 100644 --- a/src/main/lrsql/admin/routes.clj +++ b/src/main/lrsql/admin/routes.clj @@ -219,11 +219,11 @@ (ui/get-env inject-config)) :route-name :lrsql.admin.ui/get-env] ;; SPA routes - ["/admin/ui" :get (ui/get-spa proxy-path) + ["/admin/ui" :get ui/get-spa :route-name :lrsql.admin.ui/main-path] - ["/admin/ui/" :get (ui/get-spa proxy-path) + ["/admin/ui/" :get ui/get-spa :route-name :lrsql.admin.ui/slash-path] - ["/admin/ui/*path" :get (ui/get-spa proxy-path) + ["/admin/ui/*path" :get ui/get-spa :route-name :lrsql.admin.ui/sub-paths] ;; SPA redirects ["/" :get (ui/admin-ui-redirect proxy-path)