insomnia/webpack/server.js
Gregory Schier 13c8ab424c update
2016-04-13 16:32:49 -07:00

27 lines
548 B
JavaScript

'use strict';
const express = require('express');
const webpack = require('webpack');
const config = require('./dev.electron.config.js');
const app = express();
const compiler = webpack(config);
const PORT = 3333;
app.use(require('webpack-dev-middleware')(compiler, {
publicPath: config.output.publicPath,
stats: {colors: true}
}));
app.use(require('webpack-hot-middleware')(compiler));
app.listen(PORT, 'localhost', err => {
if (err) {
console.log(err);
return;
}
console.log(`Listening at http://localhost:${PORT}`);
});