Debug Functions locally
run the emulator
the functions may be called by the client
npm run serve
firebase emulators:start --only functions
call from the client
we opt-in for using the emulated cloud functions
connectFunctionsEmulator(functions, "localhost", 5001)
call from an interactive REPL shell
start the shell. it also starts the emulators. It allows to call the functions in an interactive REPL:
npm run shell
firebase functions:shell
Callable function: We provide a payload object with a mandatory data
property.
requestArticles({ data: {} })
make a direct HTTP request
The URL follows a specific pattern
http://localhost:5001/imgtale/europe-west1/request_articles
curl -s -H "Content-Type: application/json" \
-d '{ "data": { } }' \
http://localhost:5001/imgtale/europe-west1/request_articles