dispatch/client/src/js/index.js

21 lines
658 B
JavaScript
Raw Normal View History

2015-12-28 23:34:32 +00:00
import React from 'react';
import { render } from 'react-dom';
2017-02-16 02:55:50 +00:00
import 'react-virtualized/styles.css';
import Root from 'components/Root';
import initRouter from 'utils/router';
import Socket from 'utils/Socket';
2015-12-28 23:34:32 +00:00
import configureStore from './store';
import routes from './routes';
2017-05-19 05:29:44 +00:00
import runModules from './modules';
2015-12-28 23:34:32 +00:00
const production = process.env.NODE_ENV === 'production';
const host = production ? window.location.host : `${window.location.hostname}:1337`;
const socket = new Socket(host);
const store = configureStore(socket);
2017-05-19 05:29:44 +00:00
initRouter(routes, store);
runModules({ store, socket });
render(<Root store={store} />, document.getElementById('root'));