Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 5a7414a

Browse files
Support for Firebase 'Callable' functions #806 (added a proper callable function)
1 parent cf5e5db commit 5a7414a

File tree

1 file changed

+11
-0
lines changed
  • demo/firebasefunctions/functions/src

1 file changed

+11
-0
lines changed

demo/firebasefunctions/functions/src/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,14 @@ import * as functions from "firebase-functions";
66
export const helloWorld = functions.https.onRequest((request, response) => {
77
response.send("Hello from Firebase!");
88
});
9+
10+
export const helloWorldJson = functions.https.onRequest((request, response) => {
11+
response.json({"message": "Hello from Firebase!"});
12+
});
13+
14+
// this is a proper callable function
15+
export const helloName = functions.https.onCall((data, context) => {
16+
return {
17+
message: "Hello, " + data
18+
}
19+
});

0 commit comments

Comments
 (0)