📗 Rend le port configurable pour Heroku

pull/44/head
Laurent Bossavit 2017-08-28 15:32:37 +02:00
parent 586ac597db
commit 6a07c613c4
1 changed files with 4 additions and 2 deletions

View File

@ -2,6 +2,8 @@ var webpack = require('webpack')
var WebpackDevServer = require('webpack-dev-server')
var config = require('./webpack.config')
const PORT = process.env.PORT || 3000
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
@ -21,8 +23,8 @@ new WebpackDevServer(webpack(config), {
chunks: false,
chunkModules: false
}
}).listen(3000, '0.0.0.0', function (err) {
}).listen(PORT, '0.0.0.0', function (err) {
if (err)
console.log(err) //eslint-disable-line no-console
console.log('Bonjour ! Je vous sers sur localhost:3000') //eslint-disable-line no-console
console.log('Bonjour ! Je vous sers sur localhost:'+PORT) //eslint-disable-line no-console
})