简体   繁体   English

$ {PORT:-3000}在Heroku Procfile中是什么意思?

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

Heroku suggests this Procfile command to start Puma on Rails 5 setup : Heroku建议使用此Procfile命令在Rails 5安装程序上启动Puma

web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}

At first I thought 3000 was a default value, but in fact foreman uses port 5000 if PORT is missing in development. 起初,我以为3000是默认值,但实际上,如果开发中缺少PORT则领班使用端口5000。

Question: What does the notation ${VARIABLE:-3000} mean? 问题:符号${VARIABLE:-3000}是什么意思?

-- -

Update: It seems like puma is the culprit: Foreman/Puma isn't using the specified port in dev env 更新:看来puma是元凶: 工头/ Puma没有在dev env中使用指定的端口

That is the default value of the VARIABLE . 这是VARIABLE的默认值。

Use Default Values. 使用默认值。 If parameter is unset or null, the expansion of word is substituted. 如果参数未设置或为null,则替换单词的扩展名。 Otherwise, the value of parameter is substituted. 否则,将替换参数的值。

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 . 在这种情况下,如果未设置PORT变量,则其值将为3000 ;类似地,如果未设置RACK_ENV则其将被development

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM