Make sure to have Firebase CLI installed! Run each command at the root of this project.
- Run
firebase use --addto get a list of all your Firebase projects and to chose one (Blaze plan must be enabled) - Run
firebase deploy --only "functions:rest"to deploy test functions in this project
- Run
firebase emulators:startto start Firestore and Functions emulators.
Make HTTP REST calls to https://<region>-<project-id>.cloudfunctions.net/rest endpoint if you are using Cloud Testing else http://localhost:5001/<project-id>/<region>/rest if you are running Emulators
- Call
Firebase.set_emulated(true)if you are running Emulators, else callFirebase.set_emulated(false) - Call
Firebase.functions.execute("rest/<endpoint>", method: int, queryParams: {}, body: {})to call a function on the "rest" endpoint
| Type | Endpoint | Param | Body |
|---|---|---|---|
| POST | /user | null | { "firstName": string, "lastName": string } |
| GET | /user/:id | id: string | null |
| GET | /users | null | null |