Namby Pamby Magicians

    react-router-express

    1.0.0 • Public • Published

    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;
        
        // ...
      });
    })

    Install

    npm i react-router-express

    DownloadsWeekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • esnunes