diff --git a/functions/helloworld/index.js b/functions/helloworld/index.js index 270cbd1fd1..643763a9a6 100644 --- a/functions/helloworld/index.js +++ b/functions/helloworld/index.js @@ -38,11 +38,14 @@ exports.helloGET = (req, res) => { * @param {Object} req Cloud Function request context. * @param {Object} res Cloud Function response context. */ +// [START functions_tips_terminate] exports.helloHttp = (req, res) => { res.send(`Hello ${req.body.name || 'World'}!`); }; // [END functions_helloworld_http] +// [END functions_tips_terminate] + // [START functions_helloworld_background] /** * Background Cloud Function. @@ -50,9 +53,11 @@ exports.helloHttp = (req, res) => { * @param {object} event The Cloud Functions event. * @param {function} callback The callback function. */ +// [START functions_tips_terminate] exports.helloBackground = (event, callback) => { callback(null, `Hello ${event.data.name || 'World'}!`); }; +// [END functions_tips_terminate] // [END functions_helloworld_background] // [START functions_helloworld_pubsub]