diff --git a/solid-watchparty/src/App.jsx b/solid-watchparty/src/App.jsx index 0d6a4f6..14bf995 100644 --- a/solid-watchparty/src/App.jsx +++ b/solid-watchparty/src/App.jsx @@ -7,11 +7,13 @@ import LoginPage from './pages/LoginPage'; import MenuPage from './pages/MenuPage'; import WatchPage from './pages/WatchPage'; +/* config imports */ +import { BASEPATH } from './config' const router = createBrowserRouter([ - {path: "/", element: }, - {path: "/menu", element: }, - {path: "/watch", element: }, + {path: (BASEPATH + "/"), element: }, + {path: (BASEPATH + "/menu"), element: }, + {path: (BASEPATH + "/watch"), element: }, ]); function App() { diff --git a/solid-watchparty/src/config.js b/solid-watchparty/src/config.js index 9276e09..52fea71 100644 --- a/solid-watchparty/src/config.js +++ b/solid-watchparty/src/config.js @@ -1,5 +1,5 @@ +export const BASEPATH = '/solid-watch-party' /* NOTE(Elias): default POD directory structure related to the watchparty */ export const ROOMS_ROOT = 'watchparties/myRooms'; export const MESSAGES_ROOT = 'watchparties/myMessages'; - diff --git a/solid-watchparty/src/pages/LoginPage.jsx b/solid-watchparty/src/pages/LoginPage.jsx index 23759f1..58f5640 100644 --- a/solid-watchparty/src/pages/LoginPage.jsx +++ b/solid-watchparty/src/pages/LoginPage.jsx @@ -6,6 +6,9 @@ import { useLocation } from 'react-router-dom'; import SWPageWrapper from '../components/SWPageWrapper' import SWLoginButton from '../components/SWLoginButton' +/* config imports */ +import { BASEPATH } from '../config.js' + const authOptions = { clientName: "solid-watchparty", }; @@ -14,7 +17,7 @@ export default function LoginPage() { const [oidcIssuer, setOidcIssuer] = useState("http://localhost:3000/"); const currentLocation = useLocation(); - const redirectLocation = (currentLocation.state?.from || "/menu"); + const redirectLocation = (currentLocation.state?.from || `${BASEPATH}/menu`); return (
diff --git a/solid-watchparty/vite.config.js b/solid-watchparty/vite.config.js index ce1fe50..b5c730c 100644 --- a/solid-watchparty/vite.config.js +++ b/solid-watchparty/vite.config.js @@ -4,7 +4,7 @@ import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], - base: './', + base: '/solid-watch-party/', build: { outDir: '../dist' },