I can't seem to find the solution for this in the Firebase Documentation.
I want to test my functions.https.onCall
functions locally. Is it possible using the shell or somehow connect my client (firebase SDK enabled) to the local server?
I want to avoid having to deploy every time just to test a change to my onCall
functions.
Function :
exports.myFunction = functions.https.onCall((data, context) => { // Do something });
Client:
const message = { message: 'Hello.' }; firebase.functions().httpsCallable('myFunction')(message) .then(result => { // Do something // }) .catch(error => { // Error handler // });
Each Branch represents a Cloud Function. You can test or run this cloud function locally before. Once development is complete, this Cloud Function is deployed to the Google Cloud Function Service using the Google Cloud Build Service. Your development is thus directly connected to the provided function, so to speak.
For locally you must call (after firebase.initializeApp)
firebase.functions().useFunctionsEmulator('http://localhost:5000')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With