index.js 1.29 KB
Newer Older
JeongYeonwoo's avatar
JeongYeonwoo committed
1
2
3
4
import React from 'react';
import ReactDOM from 'react-dom';
import 'bootstrap/dist/css/bootstrap.min.css';
import './index.css';
5
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
6
import reportWebVitals from './reportWebVitals';
우지원's avatar
ul    
우지원 committed
7
import SignUpPage from './Pages/SignUpPage';
JeongYeonwoo's avatar
JeongYeonwoo committed
8
import ProfilePage from './Pages/ProfilePage';
우지원's avatar
우지원 committed
9
import 'bootstrap/dist/css/bootstrap.min.css';
우지원's avatar
ul    
우지원 committed
10
import LogInPage from './Pages/LogInPage';
11
import HomePage from './Pages/HomePage'
12
import PrivateRoute from './Components/PrivateRoute';
JeongYeonwoo's avatar
JeongYeonwoo committed
13
14

ReactDOM.render(
15
16
  <Router>
    <Switch>
17
18
19
      <PrivateRoute exact path="/">
        <HomePage />
      </PrivateRoute>
Choi Ga Young's avatar
   
Choi Ga Young committed
20
21
22
      <PrivateRoute path="/home">
        <HomePage />
      </PrivateRoute>
23
      <Route path="/home" component={HomePage} />
Choi Ga Young's avatar
Choi Ga Young committed
24
25
26
      <Route path="/login" component={LogInPage} />
      <Route path="/signup" component={SignUpPage} />
      <Route path="/profile" component={ProfilePage} />
Choi Ga Young's avatar
Choi Ga Young committed
27
      <PrivateRoute path="/profile">
28
        <ProfilePage />
Choi Ga Young's avatar
Choi Ga Young committed
29
      </PrivateRoute>
30

Choi Ga Young's avatar
   
Choi Ga Young committed
31

32
33
    </Switch>
  </Router>,
JeongYeonwoo's avatar
JeongYeonwoo committed
34
35
36
37
38
39
40
  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();