From 97c6e53020da622b006842ef112bc721cac0c47d Mon Sep 17 00:00:00 2001 From: Alexander Pinnecke Date: Wed, 1 Feb 2017 15:57:37 +0100 Subject: [PATCH] Fixed example in README to bind correct host --- README.md | 5 +++-- server.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4ed7a334..11342f18 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,9 @@ a direct visit from the browser. ## Example ```javascript -// Heroku defines the environment variable PORT, and requires the binding address to be 0.0.0.0 -var host = process.env.PORT ? '0.0.0.0' : '127.0.0.1'; +// Listen on a specific host via the HOST environment variable +var host = process.env.HOST || '0.0.0.0'; +// Listen on a specific port via the PORT environment variable var port = process.env.PORT || 8080; var cors_proxy = require('cors-anywhere'); diff --git a/server.js b/server.js index 520cd817..fb3f84d3 100644 --- a/server.js +++ b/server.js @@ -1,5 +1,6 @@ -// Heroku defines the environment variable PORT, and requires the binding address to be 0.0.0.0 -var host = process.env.PORT ? '0.0.0.0' : '127.0.0.1'; +// Listen on a specific host via the HOST environment variable +var host = process.env.HOST || '0.0.0.0'; +// Listen on a specific port via the PORT environment variable var port = process.env.PORT || 8080; // Grab the blacklist from the command-line so that we can update the blacklist without deploying