mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
29 lines
624 B
JavaScript
29 lines
624 B
JavaScript
import express from 'express';
|
|
import webpack from 'webpack';
|
|
import webpackDevMiddleware from 'webpack-dev-middleware';
|
|
import webpackHotMiddleware from 'webpack-hot-middleware';
|
|
|
|
import config from './webpack.config.development';
|
|
|
|
const app = express();
|
|
const compiler = webpack(config);
|
|
const PORT = 3333;
|
|
|
|
app.use(webpackDevMiddleware(compiler, {
|
|
publicPath: config.output.publicPath,
|
|
stats: {
|
|
colors: true
|
|
}
|
|
}));
|
|
|
|
app.use(webpackHotMiddleware(compiler));
|
|
|
|
app.listen(PORT, 'localhost', err => {
|
|
if (err) {
|
|
console.error(err);
|
|
return;
|
|
}
|
|
|
|
console.log(`Listening at http://localhost:${PORT}`);
|
|
});
|