Cloud Functions and Firebase Functions (or "Cloud Functions for Firebase") both look the same. Please describe the use case of each.
Both use HTTP functions.
In the Cloud Functions:
exports.helloHttp = function helloHttp (req, res) {
res.send(`Hello ${req.body.name || 'World'}!`);
};
And in the Firebase Functions:
exports.helloWorld = functions.https.onRequest((request, response) => {
response.send("Hello from Firebase!");
});
What is difference between these?
There is no product called Firebase Functions.
There are three separate things:
firebase-functions
) that you use in your Functions code to access Firebase data (such as the snapshot of the data that was written to the database)So Firebase provides a (relatively thin) wrapper around Google Cloud Functions, to make the latter product easier to use and integrate it with Firebase. In that senses it is similar to how Firebase integrates Google Cloud Storage into "Cloud Storage for Firebase" (formerly known as Firebase Storage).
If you're using Google Cloud Platform without Firebase, then you should use plain Google Cloud Functions. If you're on Firebase or if you're a mobile developer interested in Cloud Functions, you should use Cloud Functions for Firebase.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments