@@ -5,7 +5,6 @@ import ReactDOMServer from 'react-dom/server';
5
5
import { Provider } from 'react-redux' ;
6
6
import { RouterContext , match } from 'react-router' ;
7
7
import { routes } from '../common/routes' ;
8
- import createLocation from 'history/lib/createLocation' ;
9
8
import config from './config' ;
10
9
import configureStore from '../common/config/store' ;
11
10
import serveStatic from 'serve-static' ;
@@ -34,9 +33,6 @@ app.use('/dist', serveStatic(path.join(__dirname, '../dist')));
34
33
app . use ( handleRender ) ;
35
34
36
35
function handleRender ( req , res ) {
37
- // history location
38
- const location = createLocation ( req . url ) ;
39
-
40
36
// Compile an initial state
41
37
// This can come from the server somewhere if you want to pre-populate the
42
38
// app's initial state.
@@ -50,7 +46,7 @@ function handleRender(req, res) {
50
46
51
47
// See react-router's Server Rendering section:
52
48
// 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 ) => {
54
50
if ( redirectLocation ) {
55
51
res . redirect ( 301 , redirectLocation . pathname + redirectLocation . search ) ;
56
52
} else if ( error ) {
0 commit comments