Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/esnunes/react-router-express
React Router Express Location - Server Side Rendering (isomorphic)
https://github.com/esnunes/react-router-express
Last synced: about 2 months ago
JSON representation
React Router Express Location - Server Side Rendering (isomorphic)
- Host: GitHub
- URL: https://github.com/esnunes/react-router-express
- Owner: esnunes
- Created: 2015-03-16T01:45:05.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-16T03:02:37.000Z (almost 10 years ago)
- Last Synced: 2024-11-16T01:42:11.691Z (2 months ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React Router Express Location - Server Side Rendering (isomorphic)
```javascript
// server.jsimport 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;
// ...
});
})
```