Skip to content

Commit

Permalink
fix: custom base app url
Browse files Browse the repository at this point in the history
  • Loading branch information
jacovinus committed Jan 10, 2024
1 parent a6c906f commit cf14c44
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/node_modules/*
dist
dist
server
3 changes: 2 additions & 1 deletion packages/main/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
VITE_API_URL=
VITE_APP_VERSION=
VITE_APP_VERSION=
VITE_APP_BASE_URL=/
4 changes: 4 additions & 0 deletions packages/main/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ const UserRoles = lazy(() => import("../views/User/UserRoles"));

errorInterceptor(axios);

const base = document.createElement('base')
base.href = import.meta.env.VITE_APP_BASE_URL || "/"
document.head.insertBefore(base, document.head.firstChild)

ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<CookiesProvider>
Expand Down

0 comments on commit cf14c44

Please sign in to comment.