Any suggestions on how to resolve CORS errors? I seem to be encountering a CORS error while testing a simple function, and I could really use some assistance.
const functions = require('firebase-functions');
const cors = require('cors')({ origin: true });
import * as admin from 'firebase-admin';
admin.initializeApp();
exports.test = functions.https.onRequest((req, res) => {
res.set('Access-Control-Allow-Origin', '*');
res.set('Access-Control-Allow-Credentials', 'true');
res.send("hello!!");
});
//when calling in .js file
var test = firebase.functions().httpsCallable('test');
test().then(function(result) {});