forked from dienianindya/gsi_ess_mobile
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.
25 lines
926 B
25 lines
926 B
/*
|
|
* 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);
|
|
});
|