index.js 1.81 KB
Newer Older
Kim, Subin's avatar
Kim, Subin committed
1
2
import React from 'react';
import ReactDOM from 'react-dom';
Kim, Subin's avatar
Kim, Subin committed
3
import { BrowserRouter as Router, Route, Redirect, Switch } from 'react-router-dom';
Kim, Subin's avatar
Kim, Subin committed
4
import * as serviceWorker from './serviceWorker';
Kim, Subin's avatar
Kim, Subin 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';
Kim, Subin's avatar
Kim, Subin committed
9

Kim, Subin's avatar
Kim, Subin 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';
Kim, Subin's avatar
Kim, Subin committed
15
16
17
import Apply from './Pages/ApplyPage';
import Check from './Pages/CheckPage';
import Notice from './Pages/NoticePage';
18
import ACheck from './Pages/ACheckPage';
Ha YeaJin's avatar
Ha YeaJin committed
19
import Write from './Pages/WritePage';
Ha YeaJin's avatar
Ha YeaJin committed
20

CHAERIN KIM's avatar
CHAERIN KIM committed
21
22
23
axios.defaults.validateStatus = function (status) {
  return status < 500; // default
}
Kim, Subin's avatar
ㅁㅁ    
Kim, Subin committed
24

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