12345678910111213141516171819202122232425 |
- /*
- * This template contains a HTTP function that responds with a greeting when called
- *
- * Always use the FUNCTIONS HANDLER NAMESPACE
- * when writing Cloud Functions for extensions.
- * Learn more about the handler namespace in the docs
- *
- * Reference PARAMETERS in your functions code with:
- * `process.env.<parameter-name>`
- * Learn more about parameters in the docs
- */
-
- const functions = require('firebase-functions');
-
- exports.greetTheWorld = functions.handler.https.onRequest((req, res) => {
- // Here we reference a user-provided parameter (its value is provided by the user during installation)
- const consumerProvidedGreeting = process.env.GREETING;
-
- // And here we reference an auto-populated parameter (its value is provided by Firebase after installation)
- const instanceId = process.env.EXT_INSTANCE_ID;
-
- const greeting = `${consumerProvidedGreeting} World from ${instanceId}`;
-
- res.send(greeting);
- });
|