I am trying to develop API for my apps using Firebase cloud functions.
Following this site to use the firebase emulator suite for development and testing locally.
Issue: The changes are not reflected in the locally emulated functions.
Steps:
index.js:
exports.test = functions.https.onRequest(async (request, response) => { response.status(200).send("First"); });
Successfully deployed the
test
method.firebase deploy --only functions:test
In Postman made the following GET request.
https://us-central1-<project-name>.cloudfunctions.net/test
Result: First
Status: 200 OKStarted the emulators:
firebase emulators:start --only functions
In Postman made the following GET request.
http://localhost:5001/<project-name>/us-central1/indexTest
Result: First
Status: 200 OK
Same as the actual deployed function.Changed the function code to:
exports.test = functions.https.onRequest(async (request, response) => { response.status(200).send("Second"); });
Getting the same result as before when hitting the emulated function in localhost. The changes are not reflected.
Also, tried stopping the emulator and starting it again. No luck.