forked from andresinaka/Transformer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
25 lines (21 loc) · 681 Bytes
/
Copy pathserver.js
File metadata and controls
25 lines (21 loc) · 681 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
const express = require('express');
const webpackDevMiddleware = require('webpack-dev-middleware');
const webpack = require('webpack');
const webpackConfig = require('./webpack.config.js');
const app = express();
const compiler = webpack(webpackConfig(process.env));
app.use(express.static(__dirname + '/www'));
app.use(webpackDevMiddleware(compiler, {
hot: true,
filename: 'bundle.js',
publicPath: '/',
stats: {
colors: true,
},
historyApiFallback: true,
}));
const server = app.listen(3000, function() {
const host = server.address().address;
const port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
});