user1354934 user1354934 - 3 months ago 11
Javascript Question

using react-router and react-router-redux. when i go to localhost:9000/ it works fine, but not localhost:9000/login

I am wondering what I am doing wrong.

Here's what my router looks like -

const router = (
<Provider store={store}>
<Router history={history}>
<Route path="/" component={App}>
<IndexRoute component={Content} />
<Route path="/login" component={Login} />
</Route>
</Router>
</Provider>
);


I updated to do what Elod suggested, however I still get the same issue :(

const router = (
<Provider store={store}>
<Router history={history}>
<Route path="/" component={App}>
<IndexRoute component={Content} />
<Route path="login" component={Footer} />
</Route>
</Router>
</Provider>
);

Answer
solution:
app.get('/*', function(req, res) { 
res.sendFile(path.resolve(__dirname) + '/index.html');
Comments