Skip to content

QCCS/React-SSR-Test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React-SSR-Test

运行

npm build
npm run start

服务端渲染

app.get('/', (req, res) => {
    const {preloadedState, content} = ssr(initialState);
    const response = template('服务端渲染', preloadedState, content);
    res.send(response);
});

客户端渲染

app.get('/client', (req, res) => {
    //把 DOM 节点,以及包依赖,打包好 -> bundle.js
    let response = template('客户端渲染');
    res.send(response);
});

About

react express服务端渲染

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published