Created
February 16, 2017 09:48
-
-
Save evserykh/2d9651a8fa9becc7cb0c5192df18b063 to your computer and use it in GitHub Desktop.
server.dev.js
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 express = require('express'); | |
var path = require('path'); | |
var webpack = require('webpack'); | |
var webpackDevMiddleware = require('webpack-dev-middleware'); | |
var webpackConfig = require(path.join(__dirname, '../../webpack.dev.config.js')); | |
var app = express(); | |
var compiler = webpack(webpackConfig); | |
app.set('view engine', 'pug'); | |
app.set('views', path.join(__dirname, '../views')); | |
app.use(webpackDevMiddleware(compiler, { | |
stats: { colors: true } | |
})); | |
app.get('*', function(req, res) { | |
res.render('index'); | |
}); | |
app.listen(3000); | |
console.log('Server is listening at http://0.0.0.0:3000'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment