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

Ha YeaJin's avatar
pages    
Ha YeaJin committed
9
10
11
import Login from './Pages/LoginPage';
import Home from './Pages/HomePage';
import Signup from './Pages/SignupPage';
12
13
import Find from './Pages/FindPage';
import Change from './Pages/ChangePage';
Ha YeaJin's avatar
pages    
Ha YeaJin committed
14
15
16
import Apply from './Pages/ApplyPage';
import Check from './Pages/CheckPage';
import Notice from './Pages/NoticePage';
Ha YeaJin's avatar
Ha YeaJin committed
17

18
19
20
axios.defaults.validateStatus = function (status) {
  return status < 500; // default
}
Kim, Chaerin's avatar
어헛    
Kim, Chaerin committed
21
22

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