2015-10-29 08:33:21 +03:00
|
|
|
const path = require('path');
|
|
|
|
const express = require('express');
|
2015-10-23 11:11:40 +03:00
|
|
|
const webpack = require('webpack');
|
|
|
|
const config = require('./webpack.config.development');
|
|
|
|
|
2015-10-29 08:33:21 +03:00
|
|
|
const app = express();
|
|
|
|
const compiler = webpack(config);
|
|
|
|
|
|
|
|
app.use(require('webpack-dev-middleware')(compiler, {
|
2016-06-04 17:36:17 +03:00
|
|
|
noInfo: true,
|
|
|
|
publicPath: config.output.publicPath,
|
2015-10-23 11:11:40 +03:00
|
|
|
stats: {
|
|
|
|
colors: true
|
|
|
|
}
|
2015-10-29 08:33:21 +03:00
|
|
|
}));
|
|
|
|
|
|
|
|
app.use(require('webpack-hot-middleware')(compiler));
|
|
|
|
|
2015-12-24 09:58:43 +03:00
|
|
|
app.get('*', function (req, res) {
|
2016-06-04 17:36:17 +03:00
|
|
|
res.sendFile(path.join(__dirname, './spec/index.html'));
|
2015-10-29 08:33:21 +03:00
|
|
|
});
|
|
|
|
|
2016-01-06 14:56:30 +03:00
|
|
|
app.listen(8080, '0.0.0.0', function (err) {
|
2016-06-04 17:36:17 +03:00
|
|
|
if (err) {
|
|
|
|
console.log(err);
|
|
|
|
return;
|
|
|
|
}
|
2015-10-29 08:33:21 +03:00
|
|
|
|
2016-06-04 17:36:17 +03:00
|
|
|
console.log('Listening at http://0.0.0.0:8080');
|
2015-10-23 11:11:40 +03:00
|
|
|
});
|