Skip to content

Instantly share code, notes, and snippets.

View somus's full-sized avatar

Somasundaram Ayyappan somus

  • Bangalore, India
View GitHub Profile
@somus
somus / mern-serverside-rendering.js
Created June 21, 2016 06:01
How server side rendering works in MERN?
// Server Side Rendering based on routes matched by React-router.
app.use((req, res) => {
match({
routes,
location: req.url
}, (err, redirectLocation, renderProps) => {
if (err) {
return res.status(500).end('Internal server error');
}