adding axios and call to backend working with the auth check middleware

This commit is contained in:
talksik
2022-03-16 09:24:05 -04:00
parent 565b01cd8e
commit 0ad5429b53
9 changed files with 85 additions and 28 deletions
+21 -9
View File
@@ -1,6 +1,13 @@
import "./App.css";
import { HashRouter, Route, Routes } from "react-router-dom";
import {
QueryClient,
QueryClientProvider,
useMutation,
useQuery,
useQueryClient,
} from "react-query";
import Home from "./pages/Home";
import Login from "./pages/Login";
@@ -8,19 +15,24 @@ import testConnection from "@nirvana/core";
testConnection();
// Create a client
const queryClient = new QueryClient();
function App() {
return (
<>
<HashRouter>
<div className="App">
<Routes>
<Route path="/" element={<Login />} />
<Route path="/home" element={<Home />} />
{/* <Route exact path="/profile/create" component={Sit} />
<QueryClientProvider client={queryClient}>
<HashRouter>
<div className="App">
<Routes>
<Route path="/" element={<Login />} />
<Route path="/home" element={<Home />} />
{/* <Route exact path="/profile/create" component={Sit} />
<Route exact path="/profile/edit" component={Sit} /> */}
</Routes>
</div>
</HashRouter>
</Routes>
</div>
</HashRouter>
</QueryClientProvider>
</>
);
}