asb_cloud_front/src/App.js

27 lines
613 B
JavaScript
Raw Normal View History

2021-04-02 17:22:34 +05:00
import './styles/App.less'
import {
BrowserRouter as Router,
Switch,
2021-04-09 17:59:35 +05:00
Route} from "react-router-dom"
2021-04-02 17:22:34 +05:00
import Login from './pages/Login'
import Main from './pages/Main'
2021-04-09 17:59:35 +05:00
import { OpenAPI } from './services/api'
import { PrivateRoute } from './components/PrivateRoute'
2021-04-02 17:22:34 +05:00
OpenAPI.BASE = 'http://localhost:3000'
OpenAPI.TOKEN = localStorage['token']
export default function App() {
return (
<Router>
<Switch>
<Route path="/login">
<Login />
</Route>
<PrivateRoute path="/">
<Main />
</PrivateRoute>
</Switch>
</Router>
)
}