Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable dev server port #61

Merged
merged 1 commit into from
Mar 31, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions template/build/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ var webpack = require('webpack')
var config = require('./webpack.dev.conf')
var proxyMiddleware = require('http-proxy-middleware')

// default port where dev server listens for incoming traffic
var port = process.env.PORT || 8080

var app = express()
var compiler = webpack(config)

Expand Down Expand Up @@ -57,10 +60,10 @@ app.use(hotMiddleware)
// serve pure static assets
app.use('/static', express.static('./static'))

module.exports = app.listen(8080, function (err) {
module.exports = app.listen(port, function (err) {
if (err) {
console.log(err)
return
}
console.log('Listening at http://localhost:8080\n')
console.log('Listening at http://localhost:' + port + '\n')
})