Speech as a package #416

Merged
bones7242 merged 89 commits from speech-as-a-package into master 2018-04-18 21:47:34 +02:00
4 changed files with 4214 additions and 5 deletions
Showing only changes of commit 579bf87637 - Show all commits

4200
index.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -7,11 +7,16 @@ import { Reducers, GAListener, App } from 'spee.ch-components';
import renderFullPage from './renderFullPage.js';
import Helmet from 'react-helmet';
const siteConfig = require('siteConfig.js');
module.exports = (req, res) => {
let context = {};
// customize the reducer by passing in intial state configs
const customizedReducers = Reducers(siteConfig);
// create a new Redux store instance
const store = createStore(Reducers);
const store = createStore(customizedReducers);
// render component to a string
const html = renderToString(
@ -40,4 +45,6 @@ module.exports = (req, res) => {
// send the rendered page back to the client
res.send(renderFullPage(helmet, html, preloadedState));
console.log('hello from spee.ch handlePageRender.jsx');
};

View file

@ -10,6 +10,10 @@ import { Reducers, GAListener, App, Sagas, Actions } from 'spee.ch-components';
import Helmet from 'react-helmet';
// configure the reducers by passing initial state configs
const siteConfig = require('siteConfig.js');
const customizedReducers = Reducers(siteConfig);
const returnSagaWithParams = (saga, params) => {
return function * () {
yield call(saga, params);
@ -24,7 +28,7 @@ module.exports = (req, res) => {
const middleware = applyMiddleware(sagaMiddleware);
// create a new Redux store instance
const store = createStore(Reducers, middleware);
const store = createStore(customizedReducers, middleware);
// create saga
const action = Actions.onHandleShowPageUri(req.params);
@ -60,4 +64,6 @@ module.exports = (req, res) => {
// send the rendered page back to the client
res.send(renderFullPage(helmet, html, preloadedState));
});
console.log('hello from spee.ch handleShowRender.jsx');
};