Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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)

Awesome Lists containing this project

README

        

# React Router Express Location - Server Side Rendering (isomorphic)

```javascript
// 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;

// ...
});
})
```