Skip to content

Commit

Permalink
same as before fix routing
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeshau committed Nov 11, 2024
1 parent 8080706 commit e1614e1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
13 changes: 7 additions & 6 deletions packages/app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { MainPage } from "./pages/MainPage";
import AboutPage from "./pages/AboutPage";
import NotFoundPage from "./pages/NotFoundPage";


import "./styles.css";
import {
HashRouter as Router, // Use HashRouter instead of BrowserRouter
BrowserRouter as Router,
Route,
Routes,
Link,
Expand All @@ -16,13 +18,12 @@ import { ConnectButton } from "@rainbow-me/rainbowkit";

const App = () => {
return (
<Router>
<Router basename="/">
<div>
<Routes>
<Route path="/" element={<MainPage />} />
<Route path="/about" element={<AboutPage/>} />
<Route element={<>Not found</>} />
<Route path="*" element={<>Not found</>} />
<Route path="/" element={<MainPage />} />
<Route path="/about" element={<AboutPage />} />
<Route path="*" element={<NotFoundPage />} /> {/* Add a catch-all route with path="*" */}
</Routes>
</div>
</Router>
Expand Down
8 changes: 8 additions & 0 deletions packages/app/src/pages/NotFoundPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// NotFoundPage.tsx
import React from 'react';

const NotFoundPage: React.FC = () => {
return <div>Page Not Found</div>;
};

export default NotFoundPage;
10 changes: 3 additions & 7 deletions packages/app/vercel.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"rewrites": [
"routes": [
{
"source": "/api/(.*)",
"destination": "https://external-service.com/api/$1"
},
{
"source": "/(.*)",
"destination": "/"
"src": "/(.*)",
"dest": "/index.html"
}
]
}

0 comments on commit e1614e1

Please sign in to comment.