react-router-express
v1.0.0
Published
React Router Express Location - Server Side Rendering (isomorphic)
Downloads
3
Maintainers
Readme
React Router Express Location - Server Side Rendering (isomorphic)
// server.js
import express from 'express';
import ExpressLocation from 'express-location';
import ReactRouter from 'react-router';
import routes from './routes';
const server = express();
server.use(function (req, res, next) {
const location = new ExpressLocation(req.url, res);
ReactRouter.run(routes, location, (Handler, state) => {
if (location.redirect()) return;
// ...
});
})