Skip to content

Commit 57adb82

Browse files
committed
updated to newest dev server with html5 hisotry api fallback
1 parent 4678d10 commit 57adb82

File tree

4 files changed

+290
-87
lines changed

4 files changed

+290
-87
lines changed

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
<head>
55
<meta charset="utf-8">
6-
<meta name="description" content="">
6+
<meta name="description" content>
77
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
88
<title>React / Redux / TypeScript - starter-kit</title>
9-
<link rel="stylesheet" href="assets/loader-styles.css">
10-
<link rel="stylesheet" href="https://unpkg.com/blaze@3.2.0">
9+
<link href="assets/loader-styles.css" rel="stylesheet">
10+
<link href="https://unpkg.com/blaze@3.2.0" rel="stylesheet">
1111
</head>
1212

1313
<body>
@@ -36,7 +36,7 @@
3636
// hot-reload config
3737
SystemJS.import('systemjs-hot-reloader').then(function(HotReloader) {
3838
// if you're running server on custom port please remember to update below
39-
new HotReloader.default('http://localhost:8888');
39+
new HotReloader.default('http://localhost:3000');
4040
});
4141
// load main module of your app with SystemJS
4242
SystemJS.trace = true;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"husky": "^0.11.8",
4949
"jest": "^17.0.3",
5050
"jspm": "0.17.0-beta.32",
51-
"jspm-hmr": "^0.5.0",
51+
"jspm-hmr": "1.0.0-0",
5252
"regenerator": "^0.9.5",
5353
"shelljs": "^0.7.5",
5454
"shx": "^0.2.1",

server.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
'use strict';
22
const jspmHmrServer = require('jspm-hmr');
3+
34
const options = {
4-
open: true
5+
fallback: '/index.html',
6+
verbose: false,
57
};
68

7-
jspmHmrServer.start(options);
9+
// SERVER
10+
const server = jspmHmrServer.createServer(options);
11+
12+
server
13+
.listen(3000, (err) => {
14+
console.log('[debug] %j', server.address());
15+
console.log('\n>>> hit CTRL-C twice to exit <<<\n');
16+
})
17+
.on('error', function (err) {
18+
if (err.code === 'EADDRINUSE') {
19+
console.log(`\n[WARNING] Selected address is in use: ${URL}`);
20+
console.log(`[WARNING] Please try again using different port or address...\n`);
21+
22+
process.exit();
23+
}
24+
});

0 commit comments

Comments
 (0)