added router

This commit is contained in:
2021-08-25 14:11:48 +02:00
parent cb5e273acc
commit 37840ece32
5 changed files with 159 additions and 10 deletions

View File

@@ -1,10 +1,18 @@
import React from "react"
import FileBrowser from "./components/FileBrowser"
import { BrowserRouter as Router, Switch, Route, Redirect } from "react-router-dom"
import NotFound from "./components/NotFound"
const App: React.FC = () => {
return (
<div>
<FileBrowser/>
<Router>
<Switch>
<Route path="/f/" component={FileBrowser}/>
<Redirect from="/" exact to="/f/" />
<Route path="*" component={NotFound} />
</Switch>
</Router>
</div>
)
}