-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
27 lines (22 loc) · 580 Bytes
/
server.js
File metadata and controls
27 lines (22 loc) · 580 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const config = require('./webpack.config');
const path = require('path');
const server =
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true,
stats: {
colors: true
}
});
server.app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, './www/index.html'));
});
server.listen(8080, 'localhost', function (err) {
if (err) {
console.log(err);
}
console.log('Listening at localhost:8080');
});