text: import React from 'react';
  import ReactDOM from 'react-dom';
  import { Provider } from 'react-redux';
  import { createStore, applyMiddleware } from 'redux';
  import { Router, Route, IndexRoute, browserHistory } from 'react-router';
  import reduxThunk from 'redux-thunk';
  import { AUTH_USER } from './actions/type';
  
  import App from './components/app';
  import Signin from './components/auth/singin';
  import Signout from './components/auth/signout';
  import SignUp from './components/auth/signup';
  import Feature from './components/feature';
  import RequireAuth from './components/auth/require_auth';
  import Welcome from './components/welcome';
  import reducers from './reducers';
  
  const createStoreWithMiddleware = applyMiddleware(reduxThunk)(createStore);
  const store = createStoreWithMiddleware(reducers);
  
  // check if user is still logged in/has token so they do not have to sign in again
  const token = localStorage.getItem('token');
  // if we have a token, consider the user to be signed in
  if (token) {
    // we need to update application state, the store object has acces to dispatch
    store.dispatch({ type: AUTH_USER });
  }
  
  ReactDOM.render(
    <Provider store={store}>
      <Router history={browserHistory}>
        <Route path="/" component={App}>
          <IndexRoute component={Welcome} />
          <Route path="signin" component={Signin} />
          <Route path="signout" component={Signout} />
          <Route path="signup" component={SignUp} />
          <Route path="feature" component={RequireAuth(Feature)} />
        </Route>
      </Router>
    </Provider>
    , document.querySelector('.container'));
  