350 open graph react #360
4 changed files with 8 additions and 7 deletions
|
@ -1,11 +1,12 @@
|
|||
import React from 'react';
|
||||
import { renderToString } from 'react-dom/server';
|
||||
import { createStore } from 'redux';
|
||||
import Reducer from '../react/reducers';
|
||||
import renderFullPage from './renderFullPage.js';
|
||||
|
||||
import { Provider } from 'react-redux';
|
||||
import StaticRouter from 'react-router-dom/StaticRouter';
|
||||
import GAListener from '../react/components/GAListener';
|
||||
import App from '../react/app';
|
||||
import renderFullPage from './renderFullPage.js';
|
||||
|
||||
module.exports = (req, res) => {
|
||||
let context = {};
|
||||
|
|
|
@ -14,7 +14,7 @@ module.exports = (html, preloadedState) => {
|
|||
<script>
|
||||
window.__PRELOADED_STATE__ = ${JSON.stringify(preloadedState).replace(/</g, '\\\u003c')}
|
||||
</script>
|
||||
<script src="/static/bundle.js"></script>
|
||||
<script src="/bundle/bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Probably don't need these Probably don't need these `console.log`s here.
|
||||
import React from 'react';
|
||||
import { render } from 'react-dom';
|
||||
Probably don't need these Probably don't need these `console.log`s here.
|
||||
import { hydrate } from 'react-dom';
|
||||
Probably don't need these Probably don't need these `console.log`s here.
|
||||
import { Provider } from 'react-redux';
|
||||
import { createStore, applyMiddleware, compose } from 'redux';
|
||||
import { BrowserRouter } from 'react-router-dom';
|
||||
|
@ -35,7 +35,7 @@ if (preloadedState) {
|
|||
Probably don't need these Probably don't need these `console.log`s here.
Probably don't need these Probably don't need these `console.log`s here.
|
||||
sagaMiddleware.run(rootSaga);
|
||||
|
||||
// render the app
|
||||
render(
|
||||
Probably don't need these Probably don't need these `console.log`s here.
|
||||
hydrate(
|
||||
Probably don't need these Probably don't need these `console.log`s here.
|
||||
<Provider store={store}>
|
||||
<BrowserRouter>
|
||||
<GAListener>
|
||||
|
|
|||
Probably don't need these Probably don't need these `console.log`s here.
Probably don't need these Probably don't need these `console.log`s here.
|
|
@ -1,10 +1,10 @@
|
|||
const { site } = require('../config/speechConfig.js');
|
||||
// const handleRender = require('../helpers/handleRender.jsx');
|
||||
const handleRender = require('../helpers/handleRender.jsx');
|
||||
|
||||
module.exports = (app) => {
|
||||
// route for the home page
|
||||
app.get('/', (req, res) => {
|
||||
res.status(200).render('index');
|
||||
handleRender(req, res);
|
||||
});
|
||||
// route to display login page
|
||||
app.get('/login', (req, res) => {
|
||||
|
|
Loading…
Reference in a new issue
Probably don't need these
console.log
s here.