Skip to content

Commit 2c3f773

Browse files
committed
fix #14
1 parent 9285057 commit 2c3f773

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

app/server.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
console.log('Collecting data...');
22

3+
var path = require('path');
34
require('./buildData').then(function() {
45

56
console.log('Done.');
@@ -8,11 +9,17 @@ require('./buildData').then(function() {
89
var WebpackDevServer = require('webpack-dev-server');
910
var config = require('../webpack.config');
1011

11-
new WebpackDevServer(webpack(config), {
12+
var server = new WebpackDevServer(webpack(config), {
1213
publicPath: config.output.publicPath,
1314
hot: true,
1415
historyApiFallback: true
15-
}).listen(3000, 'localhost', function(err, result) {
16+
});
17+
18+
server.use(/.*\.html$/, function(req, res) {
19+
res.sendFile(path.join(__dirname, '..', '/index.html'));
20+
});
21+
22+
server.listen(3000, 'localhost', function(err, result) {
1623
if (err) {
1724
console.log(err);
1825
}

app/stores/locationStore.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class LocationStore extends EventEmitter {
1212
};
1313

1414
if (typeof window !== 'undefined') {
15+
16+
this._state = parsePath(window.location.pathname);
17+
1518
if (window.__locationState) {
1619
this._state = processRewrites(window.__locationState, getCurrentWindowHash());
1720
}

0 commit comments

Comments
 (0)