I am trying to parse a RSS feed using the method shown here in my firebase cloud function. I want this function to be triggered when there is a create event in my database. My code is like this:
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const { JSDOM } = require( "jsdom" );
const { window } = new JSDOM( "" );
const $ = require( "jquery" )( window );
admin.initializeApp(functions.config().firebase);
exports.onTest = functions.database.ref('/test/').onCreate((aSnapshot, context) => {
$.get("https://stackoverflow.com/feeds/question/10943544", function (data) {
console.log("hello");
});
});
return null;
});
I keep getting the following error: Cross Origin Null Forbidden
whenever the function is run. What am I doing wrong?