[英]How do I link my Heroku Config Variables to a Node.js app
I've built a simple Twitter bot using Node.js, that can be found here . 我使用Node.js构建了一个简单的Twitter机器人,可以在这里找到。 To avoid my Twitter access tokens being on view in my public Github repository I have deleted the config.js file and instead added the tokens into Heroku within the settings > config variables section. 为了避免我的Twitter访问令牌在我的公共Github存储库中被查看,我删除了config.js文件,而是在settings> config variables部分中将令牌添加到Heroku中。 I'm now struggling to 'get' or 'call' these config variables for my app. 我现在正努力为我的应用程序“获取”或“调用”这些配置变量。
Any help would be appreciated. 任何帮助,将不胜感激。
这些配置变量存储在运行进程的环境中:您可以像任何其他环境变量一样通过process.env
获取它们,例如process.env.access_token_key
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.