NodeJS我当前的Google Cloud Function名称是什么? [英] NodeJS What is my current Google Cloud Function Name?

查看:73
本文介绍了NodeJS我当前的Google Cloud Function名称是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用当前Google Cloud Function的名称来驱动某些逻辑.如何确定我的Google Cloud Function名称是什么?

I want to use the name of the current Google Cloud Function to drive some logic. How do I determine what my Google Cloud Function name is?

推荐答案

根据此页面,在Cloud Function上会自动设置一组环境变量.

According with this page, there is a set of environment variable automatically set on Cloud Function.

根据您的语言运行时选择合适的

Select the right one according with your language runtime

    nodeJS 6或8中的
  • FUNCTION_NAME
  • nodeJS10 +中的
  • K_SERVICE
  • FUNCTION_NAME in nodeJS 6 or 8
  • K_SERVICE in nodeJS10+

这篇关于NodeJS我当前的Google Cloud Function名称是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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