Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions functions/helloworld/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,26 @@ 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.
*
* @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]
Expand Down