No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 926B

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