@@ -5,7 +5,6 @@ import ReactDOMServer from 'react-dom/server';
55import { Provider } from 'react-redux' ;
66import { RouterContext , match } from 'react-router' ;
77import { routes } from '../common/routes' ;
8- import createLocation from 'history/lib/createLocation' ;
98import config from './config' ;
109import configureStore from '../common/config/store' ;
1110import serveStatic from 'serve-static' ;
@@ -34,9 +33,6 @@ app.use('/dist', serveStatic(path.join(__dirname, '../dist')));
3433app . use ( handleRender ) ;
3534
3635function handleRender ( req , res ) {
37- // history location
38- const location = createLocation ( req . url ) ;
39-
4036 // Compile an initial state
4137 // This can come from the server somewhere if you want to pre-populate the
4238 // app's initial state.
@@ -50,7 +46,7 @@ function handleRender(req, res) {
5046
5147 // See react-router's Server Rendering section:
5248 // https://github.com/rackt/react-router/blob/master/docs/guides/advanced/ServerRendering.md
53- match ( { routes, location } , ( error , redirectLocation , renderProps ) => {
49+ match ( { routes, location : req . url } , ( error , redirectLocation , renderProps ) => {
5450 if ( redirectLocation ) {
5551 res . redirect ( 301 , redirectLocation . pathname + redirectLocation . search ) ;
5652 } else if ( error ) {
0 commit comments