Skip to content
This repository was archived by the owner on Dec 9, 2021. It is now read-only.

Commit e8d9e5f

Browse files
committedAug 10, 2017
Fix issue with loading index.html
1 parent f31cc8a commit e8d9e5f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed
 

‎src/server-side/controllers/ReactController.jsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import rootSaga from '../../store/rootSaga';
88

99
class ReactController {
1010

11-
async mapRoutes(server) {
12-
const baseMarkup = await fse.readFile(path.resolve(__dirname, '../../public/index.html'), 'utf8');
13-
11+
mapRoutes(server) {
1412
server.route({
1513
method: 'GET',
1614
path: '/{route*}',
@@ -36,11 +34,11 @@ class ReactController {
3634
}
3735
};
3836

39-
let html = baseMarkup.slice();
37+
let html = await fse.readFile(path.resolve(__dirname, '../../public/index.html'), 'utf8');
4038
html = html.replace('{title}', state.metaReducer.title);
4139
html = html.replace('{description}', state.metaReducer.description);
4240
html = html.replace('{content}', renderedHtml);
43-
html = html.replace('{state}', JSON.stringify(initialState));
41+
html = html.replace('{state}', JSON.stringify(initialState));
4442

4543
// context.url will contain the URL to redirect to if a <Redirect> was used
4644
if (context.url) {

0 commit comments

Comments
 (0)