Felix Larsen

View Original

Firebase Cloud Functions Cheatsheet

When having an app with a firebase you will soon or later want to back up the configuration of the backend and/or add Cloud Functions. Here is cheatsheet for all commands to keep in mind.

The repository which is created can be backed up using the git versioning tool on github or any other provider

To set them up follow the instructions of: https://firebase.google.com/docs/functions/get-started

To update the local repository when auto-indexes have been added online:

firebase init firestore

Upload rules:

firebase deploy --only firestore:rules

Upload all functions:

firebase deploy --only functions

Upload one function:

firebase deploy --only functions:func1

Upload multiple functions:

firebase deploy --only functions:func1,functions:func2

Run linter:

cd functions
npm run lint