Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
feat(koa): Prefer PORT env var when binding
Browse files Browse the repository at this point in the history
  • Loading branch information
robertrossmann committed Nov 21, 2017
1 parent d040ade commit edcc5cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/koa/src/service.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import Koa from 'koa'
class KoaService extends Service {
static defaults = {
listen: {
port: 3000,
// It is a general best practice in the Node.js ecosystem to use the PORT env var to specify
// the port to which the web server should bind to -> let's respect that
// eslint-disable-next-line no-process-env
port: process.env.PORT || 3000,
hostname: '127.0.0.1',
},

Expand Down

0 comments on commit edcc5cd

Please sign in to comment.