[英]Setting Firebase environment variables
I have used Heroku and Netlify for storing Firebase environment variables, and it seems pretty straightforward as I can go to the website and enter them manually. 我已经使用Heroku和Netlify来存储Firebase环境变量,并且看起来很简单,因为我可以去网站并手动输入它们。 I was looking around Firebase and it seems a little more complicated.
我正在四处浏览Firebase,似乎有点复杂。 Where does everyone go to for setting environment variables for Firebase?
每个人都去哪里设置Firebase的环境变量? Is there a sure fire way to do it on the website by just entering in the values?
只需输入值,在网站上有没有确定的解决方法? I'm currently messing around with create-react-app.
我目前正在搞混create-react-app。
I know this is a little after the fact but you set firebase environment variables from the command line using 我知道这是事实,但您可以使用以下命令从命令行设置firebase环境变量
firebase functions:config:set someObject.key1="www.api.com" someObject.key2="someOtherKey"
then access them using the firebase-functions npm package 然后使用firebase-functions npm软件包访问它们
var api = functions.config().someObject.key1;
I will happily admit it's nowhere near as simple as the way Heroku/Amazon do it where they just append variables to process.ENV and it can all be configured from a UI 我会很高兴地承认,它远没有Heroku / Amazon那样简单,它们只是将变量附加到process.ENV,而且都可以通过UI进行配置
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.