feat: change API router structure

This commit is contained in:
2025-02-11 14:14:23 +01:00
parent 55b7b6f206
commit e89a2eea20
5 changed files with 55 additions and 21 deletions

View File

@@ -8,7 +8,7 @@ import { BrowserRouter, Routes, Route } from "react-router-dom";
function App() {
//const [data, setData] = useState({ nodes: [], links: [] } as SociogramData);
//async function loadData() {
// await fetch(`${baseUrl}analysis/json`, { method: "GET" }).then(resp => resp.json() as unknown as SociogramData).then(json => { setData(json) })
// await fetch(`${baseUrl}api/analysis/json`, { method: "GET" }).then(resp => resp.json() as unknown as SociogramData).then(json => { setData(json) })
//}
//useEffect(() => { loadData() }, [])
//
@@ -17,7 +17,7 @@ function App() {
<Header />
<Routes>
<Route index element={<Rankings />} />
<Route path="analysis" element={<Analysis />} />
<Route path="/analysis" element={<Analysis />} />
</Routes>
<Footer />
</BrowserRouter>