index.js 1.28 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';
Lee SeoYeon's avatar
.    
Lee SeoYeon committed
5
6
import App from './App'
import Search from './Search';
Kim, Chaerin's avatar
Kim, Chaerin committed
7
import reportWebVitals from './reportWebVitals';
Lee SeoYeon's avatar
0111    
Lee SeoYeon committed
8
9
import Signup from './Components/Signup'
import Login from './Components/Login'
Lee SeoYeon's avatar
.    
Lee SeoYeon committed
10
11
import PrivateRoute from "./Components/PrivateRoute";
import Bookmark from "./Bookmark"
Kim, Chaerin's avatar
Kim, Chaerin committed
12
13
14
15
16
17
import {
  BrowserRouter as Router,
  Switch,
  Route,
  Redirect,
} from "react-router-dom";
baesangjune's avatar
.    
baesangjune committed
18

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

Kim, Chaerin's avatar
Kim, Chaerin committed
23
24
25
26
27
28
ReactDOM.render(
  <React.StrictMode>
    <Router>
      <Switch>
        <Route exact path="/" component={App} />
        <Route path="/search" component={Search} />
Lee SeoYeon's avatar
0111    
Lee SeoYeon committed
29
30
        <Route path='/signup' component={Signup}/>
        <Route path='/login' component={Login} />
31
        <Redirect path="/search/:search" to="/search" />
Lee SeoYeon's avatar
.    
Lee SeoYeon committed
32
        <PrivateRoute path='/bookmark'><Bookmark/></PrivateRoute>
Kim, Chaerin's avatar
Kim, Chaerin committed
33
34
35
36
37
38
39
40
41
42
      </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();