如何在Heroku上动态设置phantomJS命令行选项

如何在Heroku上动态设置phantomJS命令行选项,heroku,phantomjs,Heroku,Phantomjs,我有一个phantomjs应用程序在heroku上运行。我需要能够设置几个通常由命令行()访问的命令,最好是在运行时,但如果需要,每天一次 我想将heroku procfile设置为: phantomjs --config=/path/to/config.json somescript.js 其中config.json看起来像 { /* Same as: --ignore-ssl-errors=true */ "ignoreSslErrors": true, /* Same as: --ma

我有一个phantomjs应用程序在heroku上运行。我需要能够设置几个通常由命令行()访问的命令,最好是在运行时,但如果需要,每天一次

我想将heroku procfile设置为:

phantomjs --config=/path/to/config.json somescript.js
其中config.json看起来像

{
/* Same as: --ignore-ssl-errors=true */
"ignoreSslErrors": true,

/* Same as: --max-disk-cache-size=1000 */
"maxDiskCacheSize": 1000,

/* Same as: --output-encoding=utf8 */
"outputEncoding": "utf8"

/* etc. */
}

我的想法是,在运行phantomjs应用程序之前,我想将json对象上传到heroku临时文件系统。我希望当它运行时,它将使用更新的配置文件。这似乎合理吗?有人试过这样的方法吗?

我会设置一个变量

heroku config:set NAME=VALUE
它是在运行时读取的,所以您可以随时更改它


如果您需要更频繁地更改配置变量,还可以通过它们的API:,来更新配置变量。

我会通过

heroku config:set NAME=VALUE
它是在运行时读取的,所以您可以随时更改它


如果您需要更频繁地更改配置变量,还可以通过它们的API:,更新它们。

Alberto,我不知道这种方法。我会仔细阅读的。谢谢比尔·阿尔贝托,我不知道这种方法。我会仔细阅读的。谢谢比尔