Skip to content

HelloWorld with Google Cloud Function

   

Because I touched the Cloud Function of Google, it is the note.
This is the output and get in HelloWorld and Json.

const functions = require('firebase-functions');
exports.helloWorld = functions.https.onRequest((request, response) => {
response.send("Hello from Firebase!");
});
exports.json = functions.https.onRequest((request, response) => {
const json = {
id: "Hello",
contributions: "contributions",
};
response.send(JSON.stringify(json));
});
exports.goodEvening = functions.https.onRequest((request, response) => {
var str_out = ""
const user = request.query.user
str_out += "user = " + user
response.send(str_out)
});
view raw index.js hosted with ❤ by GitHub