Ad

Use Of Firebase Functions When Using Firebase Hosting Locally

I currently have my project setup with firebase functions being used for some of the backend functions.

I want to be able to test these functions locally when typing in firebase serve when I use the website, not querying the function using postman, for example.

Is there any way I can do this?

I've tried just typing in firebase serve but this gives me the functions that have been deployed to firebase, not the ones that I have changed locally.

Thank you very much in advance.

Ad

Answer

I've found that you use

firebase.functions().useFunctionsEmulator('http://localhost:5001');

to use locally hosted functions.

Ad
source: stackoverflow.com
Ad