I have a firebase configuration file inside my tools/apache/htdocs/apps/config/firebase-config.json
I need this config file in my serviceworker tools/apache/htdocs/firebase-messaging-sw.js
Is there any way in es5?
Advertisement
Answer
fetch("./config/firebaseConf.json").then(function (res) {
return res.json();
}).then(function (data) {
var firebase = data;
})
The above code worked for me.