index.js 1.07 KB
Newer Older
Kim, Chaerin's avatar
Kim, Chaerin committed
1
2
3
4
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import 'bootstrap/dist/css/bootstrap.min.css';
Kim, Chaerin's avatar
?    
Kim, Chaerin committed
5
6
import App from './Pages/App';
import Search from './Pages/Search';
7
import axios from 'axios';
Kim, Chaerin's avatar
Kim, Chaerin committed
8
9
10
11
12
13
14
import reportWebVitals from './reportWebVitals';
import {
  BrowserRouter as Router,
  Switch,
  Route,
  Redirect,
} from "react-router-dom";
baesangjune's avatar
.    
baesangjune committed
15

baesangjune's avatar
.    
baesangjune committed
16
17
18
19

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

21
22
23
24
axios.defaults.validateStatus = function (status) {
  return status < 500; // default
}

Kim, Chaerin's avatar
Kim, Chaerin committed
25
26
27
28
29
30
ReactDOM.render(
  <React.StrictMode>
    <Router>
      <Switch>
        <Route exact path="/" component={App} />
        <Route path="/search" component={Search} />
31
        <Redirect path="/search/:search" to="/search" />
Kim, Chaerin's avatar
Kim, Chaerin committed
32
33
34
35
36
37
38
39
40
41
      </Switch>
    </Router>
  </React.StrictMode>,
  document.getElementById('root')
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();