Skip to content

Commit 1b297e9

Browse files
authored
Add 404 page (#8)
* Add postbuild script to copy 404.html using index.html * Revert route for home in app
1 parent 87eee07 commit 1b297e9

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"scripts": {
66
"dev": "vite",
77
"build": "tsc -b && vite build",
8+
"postbuild": "cp dist/index.html dist/404.html",
89
"lint": "eslint .",
910
"preview": "vite preview"
1011
},

web/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ function App() {
88
<div className="page">
99
<main className="content">
1010
<Routes>
11+
<Route path="/" element={<Home />} />
1112
<Route path="/posts/:slug" element={<Post />} />
12-
<Route path="*" element={<Home />} />
1313
</Routes>
1414
</main>
1515
</div>

0 commit comments

Comments
 (0)