index.js 1.4 KB
Newer Older
Choi Ga Young's avatar
Choi Ga Young committed
1
2
3
import React from 'react';
import ReactDOM from 'react-dom';
import * as serviceWorker from './serviceWorker';
Choi Ga Young's avatar
Choi Ga Young committed
4
import { BrowserRouter as Router, Route, Redirect, Switch } from 'react-router-dom';
Choi Ga Young's avatar
Choi Ga Young committed
5
import 'bootstrap';
Choi Ga Young's avatar
Choi Ga Young committed
6
import 'bootstrap/dist/css/bootstrap.css';
CHAERIN KIM's avatar
CHAERIN KIM committed
7
import axios from 'axios';
CHAERIN KIM's avatar
CHAERIN KIM committed
8
import { PrivateRoute } from './Components/PrivateRoute';
Ha YeaJin's avatar
login    
Ha YeaJin committed
9

Ha YeaJin's avatar
pages    
Ha YeaJin committed
10
11
12
13
14
15
import Login from './Pages/LoginPage';
import Home from './Pages/HomePage';
import Signup from './Pages/SignupPage';
import Apply from './Pages/ApplyPage';
import Check from './Pages/CheckPage';
import Notice from './Pages/NoticePage';
Choi Ga Young's avatar
Choi Ga Young committed
16

CHAERIN KIM's avatar
CHAERIN KIM committed
17
18
19
axios.defaults.validateStatus = function (status) {
  return status < 500; // default
}
CHAERIN KIM's avatar
CHAERIN KIM committed
20

Choi Ga Young's avatar
Choi Ga Young committed
21
ReactDOM.render(
Choi Ga Young's avatar
Choi Ga Young committed
22
23
<Router>
    <Switch>
CHAERIN KIM's avatar
CHAERIN KIM committed
24
25
      <PrivateRoute exact path="/" component={Home} />
      <Route path="/login" component={Login} />
Choi Ga Young's avatar
Choi Ga Young committed
26
      <Route path="/home" component={Home} />
Ha YeaJin's avatar
pages    
Ha YeaJin committed
27
28
29
30
      <Route path="/signup" component={Signup} />
      <Route path="/apply" component={Apply} />
      <Route path="/check" component={Check} />
      <Route path="/notice" component={Notice} />
CHAERIN KIM's avatar
CHAERIN KIM committed
31
32
      <Redirect path="/login" to="/" />
      <Redirect path="/home" to="/" />
Choi Ga Young's avatar
Choi Ga Young committed
33
34
    </Switch>
  </Router>,
Choi Ga Young's avatar
Choi Ga Young committed
35
36
37
38
39
40
41
  document.getElementById('root')
);

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();