Skip to content

Commit

Permalink
🚑 add basepath to react router
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasnijs committed Feb 28, 2024
1 parent 5c0a3f9 commit df74405
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions solid-watchparty/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: <LoginPage/>},
{path: "/menu", element: <MenuPage/>},
{path: "/watch", element: <WatchPage/>},
{path: (BASEPATH + "/"), element: <LoginPage/>},
{path: (BASEPATH + "/menu"), element: <MenuPage/>},
{path: (BASEPATH + "/watch"), element: <WatchPage/>},
]);

function App() {
Expand Down
2 changes: 1 addition & 1 deletion solid-watchparty/src/config.js
Original file line number Diff line number Diff line change
@@ -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';

0 comments on commit df74405

Please sign in to comment.