From 6a07c613c4ff3df4cf1c4dabcde419a573680800 Mon Sep 17 00:00:00 2001 From: Laurent Bossavit Date: Mon, 28 Aug 2017 15:32:37 +0200 Subject: [PATCH] :green_book: Rend le port configurable pour Heroku --- source/server.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/server.js b/source/server.js index e4d8333ff..3b129adde 100644 --- a/source/server.js +++ b/source/server.js @@ -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 })