Why Is Foreman Gem Ignoring the Port Environment Variable

Why is foreman gem ignoring the PORT environment variable?

Looking at the code: https://github.com/ddollar/foreman/blob/master/lib/foreman/process.rb it looks foreman will only take the PORT as a command line argument.

What does ${PORT:-3000} mean in Heroku Procfile?

That is the default value of the VARIABLE.

Use Default Values. If parameter is unset or null, the expansion of
word is substituted. Otherwise, the value of parameter is
substituted.

From: https://www.gnu.org/software/bash/manual/bash.html#Shell-Parameter-Expansion

In this case if the PORT variable is not set then its value will be 3000 and similarly if RACK_ENV is not set then it will be development.



Related Topics



Leave a reply



Submit