nice setup with v2 with typescript and now ready to just hound out functions

This commit is contained in:
Arjun Patel
2022-01-27 17:56:20 -08:00
parent 36092e8af7
commit 1ac2dcc3a6
25 changed files with 14020 additions and 2684 deletions
+23
View File
@@ -0,0 +1,23 @@
const functions = require("firebase-functions");
const admin = require("firebase-admin");
var express = require("express");
const app = express();
admin.initializeApp();
app.get("/", (req, res) => res.send("Hello World!"));
exports.helloworld = functions.https.onRequest(app);
const agora = require("./agora");
exports.agoraToken = functions.https.onCall((data, context) => {
console.log(data);
console.log("user's id: " + context.auth.uid);
const channelName = data.channelName;
let token = agora.getAgoraToken(channelName);
return { token };
});