index.js 1.63 KB
Newer Older
Ha YeaJin's avatar
Ha YeaJin committed
1
2
3
import React from 'react';
import ReactDOM from 'react-dom';
import * as serviceWorker from './serviceWorker';
Ha YeaJin's avatar
login    
Ha YeaJin committed
4
import { BrowserRouter as Router, Route, Redirect, Switch } from 'react-router-dom';
Ha YeaJin's avatar
Ha YeaJin committed
5
6
// import 'bootstrap';
// 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
import Login from './Pages/LoginPage';
import Home from './Pages/HomePage';
import Signup from './Pages/SignupPage';
13
14
import Find from './Pages/FindPage';
import Change from './Pages/ChangePage';
Ha YeaJin's avatar
pages    
Ha YeaJin committed
15
16
17
import Apply from './Pages/ApplyPage';
import Check from './Pages/CheckPage';
import Notice from './Pages/NoticePage';
Ha YeaJin's avatar
Ha YeaJin committed
18

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

Ha YeaJin's avatar
Ha YeaJin committed
23
ReactDOM.render(
Ha YeaJin's avatar
login    
Ha YeaJin committed
24
25
<Router>
    <Switch>
CHAERIN KIM's avatar
CHAERIN KIM committed
26
27
      <PrivateRoute exact path="/" component={Home} />
      <Route path="/login" component={Login} />
Ha YeaJin's avatar
as    
Ha YeaJin committed
28
      <Route path="/home" component={Home} />
Ha YeaJin's avatar
pages    
Ha YeaJin committed
29
      <Route path="/signup" component={Signup} />
30
31
      <Route path="/find" component={Find} />
      <Route path="/change" component={Change} />
CHAERIN KIM's avatar
CHAERIN KIM committed
32
      <Route path="/apply/:id" component={Apply} />
33
      <Route path="/check/:id" component={Check} />
Ha YeaJin's avatar
pages    
Ha YeaJin committed
34
      <Route path="/notice" component={Notice} />
35
      <Redirect path="/" to="/" />
CHAERIN KIM's avatar
CHAERIN KIM committed
36
      <Redirect path="/home" to="/" />
37
      <Redirect path="/change/:id" to="/change"/>
Ha YeaJin's avatar
login    
Ha YeaJin committed
38
39
    </Switch>
  </Router>,
Ha YeaJin's avatar
Ha YeaJin committed
40
41
42
43
44
45
46
  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();