isomorphic react app
- react
- redux
- immutableJS
- express
- ES2015
- webpack
- babel 6
- npm install react-ocean
- npm run build:dev // for development
- contains 'in-line-source-map' for debugging
- redux-logger
- redux-dev-tool(window.devToolsExtension)
- 'why-did-you-update' avoidable re-render checking
- react hot module replacing
- npm run build:prod // for production
- npm run build // both
- register server route
router.get('/', getIndex);
- define appName and renderData for server render
module.exports = function (req, res, next) {
let pageStr = createRenderString(req, {
component: <Page/>,
locals: {
appName: 'index',
title: 'index page'
},
renderData: fakeData,
rootReducer
});
res.status(200).send(pageStr);
};
- add a client page whose name is the same as appName
initializeRender({
rootReducer,
component: <Page/>
})
- todos
- async action
##todo:
- add pm2 module