Skip to content

Commit

Permalink
Remove proxy-path from get-spa
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinqian00 committed Nov 21, 2024
1 parent 29c3922 commit c4959bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/main/lrsql/admin/interceptors/ui.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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"))))
Expand Down
6 changes: 3 additions & 3 deletions src/main/lrsql/admin/routes.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c4959bd

Please sign in to comment.