问题
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?
回答1:
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
FUNCTION_NAMEin nodeJS 6 or 8K_SERVICEin nodeJS10+
来源:https://stackoverflow.com/questions/62388694/nodejs-what-is-my-current-google-cloud-function-name