Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to deploy a Firebase function named 'helloWorld'.
Firebase
exports.helloWorld = functions.[1]((req, res) => { res.send('Hello from Firebase!'); });
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using firestore triggers instead of HTTP triggers.
Using database triggers for HTTP functions.
✗ Incorrect
The correct method to deploy an HTTP function in Firebase is https.onRequest.
2fill in blank
mediumComplete the command to deploy all Firebase functions.
Firebase
firebase [1] --only functions Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'serve' which runs local emulators.
Using 'init' which initializes a project.
✗ Incorrect
The firebase deploy command uploads and deploys your functions to Firebase.
3fill in blank
hardFix the error in the function trigger type to deploy an HTTP function.
Firebase
exports.myFunction = functions.[1]((req, res) => { res.send('Done'); });
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using database or Firestore triggers for HTTP functions.
Using storage triggers for HTTP functions.
✗ Incorrect
HTTP functions require the https.onRequest trigger.
4fill in blank
hardFill both blanks to deploy only the 'auth' and 'firestore' Firebase emulators.
Firebase
firebase emulators:start --only [1],[2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Including functions emulator when not required.
Using database instead of firestore.
✗ Incorrect
The auth and firestore emulators are started by specifying them with --only.
5fill in blank
hardFill all three blanks to initialize Firebase functions with TypeScript and ESLint.
Firebase
firebase init functions ? What language would you like to use to write Cloud Functions? [1] ? Do you want to use ESLint to catch probable bugs and enforce style? [2] ? Do you want to install dependencies with npm now? [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing JavaScript instead of TypeScript.
Skipping ESLint setup.
Not installing dependencies immediately.
✗ Incorrect
Choose TypeScript for language, Yes to use ESLint, and Yes to install dependencies immediately.