为Firebase功能设置NODE_ENV

为Firebase功能设置NODE_ENV

问题描述:

我将一些firebase-queue工作人员转移到Firebase Functions.我已经使用process.env.NODE_ENV为工作程序设置了一些配置,具体取决于运行它们的环境.有没有一种方法可以在部署功能时设置NODE_ENV.我知道提供这种配置选项的推荐方法是通过firebase.config.set,我已经验证了它的预期效果,但是只是想检查是否还有一种方法可以设置NODE_ENV.当我尝试打印出函数内部的NODE_ENV时,它总是设置为production.

I am moving some of my firebase-queue workers to Firebase Functions. I have used process.env.NODE_ENV to set some of the configuration for the workers depending on the environment in which I am running them. Is there a way to set the NODE_ENV for the functions while deploying them. I understand that the recommended way to provide such config options is via firebase.config.set which I have verified works as expected but just wanted to check if there is a way to set the NODE_ENV also. When I try to print out the NODE_ENV inside of a function, it is always set to production.