简体   繁体   English

如何将我的Heroku配置变量链接到Node.js应用程序

[英]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. 任何帮助,将不胜感激。

Config Variables Heroku 配置变量Heroku

这些配置变量存储在运行进程的环境中:您可以像任何其他环境变量一样通过process.env获取它们,例如process.env.access_token_key

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

相关问题 如何仅在node.js heroku应用程序上授予对我的网站的访问权限 - How do i grant access to my site only on a node.js heroku app 如何在Node.js App Heroku中的.env文件中访问变量 - How to access variables in .env file in node.js app heroku 如何使用MongoHQ和Node.js在Heroku上设置MongoDB? - How do I setup MongoDB on Heroku with MongoHQ and Node.js? 如何将node.js服务器变量传递到我的angular / html视图中? - How do I pass node.js server variables into my angular/html view? 如何<a>在 node.js 中</a>获取点击<a>链接</a>的名称<a>?</a> - How do I get the name of a clicked <a> link in node.js? 如何将node.js Web应用程序上传到openshift? 它不是在git上,而是在我的计算机上? - How do I upload my node.js web app to openshift? It is NOT on git, but just on my computer? 在 node.js 中无法访问 Heroku 配置变量? - Heroku config vars not accessible in node.js? 如何在我的简单Express应用程序中使用Node.js群集? - How do I use Node.js clusters with my simple Express app? 如何在我的Node.js应用程序中整合模型和控制器? - How Do I Incorporate Models and Controllers In My Node.js App? 如何在我的node.js Web应用程序中包含jQuery代码? - How do I include jQuery code in my node.js web app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM