forked from glennreyes/react-countup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
20 lines (17 loc) · 703 Bytes
/
server.js
File metadata and controls
20 lines (17 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const Express = require('express');
const webpack = require('webpack');
const webpackDevMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
const config = require('./webpack.config');
const app = new Express();
const port = process.env.PORT || 3000;
const compiler = webpack(config);
app.use(webpackDevMiddleware(compiler, { noInfo: true, publicPath: config.output.publicPath }));
app.use(webpackHotMiddleware(compiler));
app.listen(port, (error) => {
if (error) {
console.error(error); // eslint-disable-line no-console
} else {
console.info(`Start demo at http://localhost:${port}`); // eslint-disable-line no-console
}
});