Created
November 19, 2015 21:59
-
-
Save anonymous/503da89311dd2e9fa9a6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
var express = require('express'); | |
var webpack = require('webpack'); | |
var config = require('./webpack.config.dev'); | |
var fs = require('fs'); | |
var app = express(); | |
var compiler = webpack(config); | |
app.use(require('webpack-dev-middleware')(compiler, { | |
publicPath: config.output.publicPath, | |
noInfo: true | |
})); | |
app.use(require('webpack-hot-middleware')(compiler)); | |
app.get('*', function(req, res) { | |
res.sendFile(path.join(__dirname, 'index.html')); | |
}); | |
app.listen(3000, '0.0.0.0', function(err) { | |
if (err) { | |
console.log(err); | |
return; | |
} | |
console.log('Listening at http://localhost:3000'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment