Skip to content

How to use firebase emulator to test storage and firestore triggers? #117

Answered by di
manuganji asked this question in Q&A
Discussion options

You must be logged in to vote

Install firebase-tools:

$ npm install -g firebase-tools

Install the firestore emulator:

$ firebase setup:emulators:firestore

Write a basic "background" function:

def hello(data, context):
    print(data, context)

Install the Functions Framework:

$ pip install functions-framework

In one terminal, start the Functions Framework (by default this will be on localhost:8080):

$ functions-framework --target hello --signature-type event

In a second terminal, start the emulator (on a different port, localhost:8081) and tell it which host/port to use for the functions emulator:

$ java -jar ~/.cache/firebase/emulators/cloud-firestore-emulator-v1.11.11.jar --functions_emulator localhost:8080 --por…

Replies: 7 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by di
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #104 on March 09, 2021 02:11.