Node-1st-gen/quickstarts/uppercase-firestore/README.md
This quickstart demonstrates using the Firebase SDK for Cloud Functions with Firestore.
This sample app does two things:
Before you can test the functions locally or deploy to a Firebase project,
you'll need to run npm install in the functions directory.
The Firebase Local Emulator Suite allows you to build and test apps on your local machine instead of deploying to a Firebase project.
Create a Firebase project in the Firebase Console
Wondering why this step is needed? Even though the emulator will run this sample on your local machine, it needs to interact with a Firebase project to retrieve some configuration values.
Run firebase emulators:start
Open the Emulator Suite UI
firebase emulators:start command for the URL
of the Emulator Suite UI. It defaults to
localhost:4000, but may be hosted on a different
port on your machine.Trigger the functions
firebase emulators:start command for the URL
of the http function "addMessage". It will look similar to:
http://localhost:5001/MY_PROJECT/us-central1/addMessage
MY_PROJECT will be replaced with your project ID?text=uppercaseme to the end of the function's URL.
It should now look something like:
http://localhost:5001/MY_PROJECT/us-central1/addMessage?text=uppercaseme
View the effects of the functions in the Emulator Suite UI
In the "Logs" tab, you should see new logs indicating that the functions "addMessage" and "makeUppercase" ran:
functions: Beginning execution of "addMessage"
functions: Beginning execution of "makeUppercase"
In the "Firestore" tab, you should see a document containing your original message as well as the uppercased version of your message (if it was originally "uppercaseme", you'll see "UPPERCASEME")
To deploy and test the sample:
firebase deployYou should see your text value displayed in the console and uppercase.
We'd love that you contribute to the project. Before doing so please read our Contributor guide.
© Google, 2016. Licensed under an Apache-2 license.