Skip to content

Commit

Permalink
Added routes
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashonecker committed Jun 19, 2024
1 parent d1a17ed commit f7ec6a2
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 7 deletions.
132 changes: 131 additions & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
"@fontsource/roboto": "^5.0.13",
"@mui/icons-material": "^5.15.20",
"@mui/material": "^5.15.20",
"axios": "^1.7.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"react-router-dom": "^6.23.1"
},
"devDependencies": {
"@types/react": "^18.2.66",
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import * as React from "react";
import CssBaseline from "@mui/material/CssBaseline";
import LoginPage from "./components/LoginPage.tsx";
import { Route, Routes } from "react-router-dom";

export default function App() {
return (
<React.Fragment>
<CssBaseline />
<LoginPage />
<Routes>
<Route path="/" element={<div>Main Page</div>} />
<Route path="/login" element={<LoginPage />} />
</Routes>
</React.Fragment>
);
}
5 changes: 4 additions & 1 deletion frontend/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import { BrowserRouter } from "react-router-dom";

ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<App />
<BrowserRouter>
<App />
</BrowserRouter>
</React.StrictMode>,
);
13 changes: 10 additions & 3 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})
server: {
proxy: {
"/api": {
target: "http://localhost:8080",
},
},
},
});

0 comments on commit f7ec6a2

Please sign in to comment.