begin integrating frontend and backend
This commit is contained in:
@@ -13,7 +13,7 @@ createRoot(document.getElementById('root')!).render(
|
||||
<Navbar />
|
||||
<Routes>
|
||||
<Route path="/" element={<Home />} />
|
||||
<Route path="/article/:articleId" element={<Article />} />
|
||||
<Route path="/article/:slug" element={<Article />} />
|
||||
<Route path="/articleList" element={<ArticleList />} />
|
||||
</Routes>
|
||||
</BrowserRouter>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { useParams } from 'react-router';
|
||||
// import { useState, useEffect } from 'react';
|
||||
|
||||
export default function Article() {
|
||||
let { articleId } = useParams();
|
||||
let { slug } = useParams();
|
||||
|
||||
return (
|
||||
<div id="article">
|
||||
<h1>Article: {articleId}</h1>
|
||||
<h1>Article: {slug}</h1>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
+11
-1
@@ -12,4 +12,14 @@ export default defineConfig({
|
||||
},
|
||||
})
|
||||
],
|
||||
})
|
||||
// DEV PROXY
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:3000',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, '')
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user