应用程序环境中的Heroku应用程序ID [英] Heroku app id within the application environment

查看:86
本文介绍了应用程序环境中的Heroku应用程序ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在应用程序环境中检索应用程序ID(app123@heroku.com)?

Is it possible to retrieve the app id (app123@heroku.com) within the application environment?

我知道,我可以手动设置一个配置变量,但是我想这样的信息可能会被Heroku公开吗?

I know, that I can manually set a config var, but I figured such info could be exposed by Heroku?

推荐答案

如果安装了诸如SendGrid或Memcache之类的加载项,则可以访问其中一个加载项的用户名的环境变量.例如,如果您使用的是Ruby,则可以登录到控制台并输出ENV ['SENDGRID_USERNAME']或ENV ['MEMCACHE_USERNAME']的值.从那里提取应用程序ID很容易.我不确定哪个其他加载项也会在环境变量中公开该值,但是您可以输出整个ENV全局哈希并找出可用的值.

If you have an add-on like SendGrid or Memcache installed, you can access the environment variables for the username of one of those add-ons. For example, if you were using Ruby, you can log into the console and output the value of ENV['SENDGRID_USERNAME'] or ENV['MEMCACHE_USERNAME']. It's easy to extract the app id from there. I'm not sure which other add-ons also expose that value in an environment variable but you can output the entire ENV global hash and find out what's available.

这篇关于应用程序环境中的Heroku应用程序ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆