0
0
Firebasecloud~10 mins

Function deployment in Firebase - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
AhttpsCallable
Bfirestore.document
Chttps.onRequest
Ddatabase.ref
Attempts:
3 left
💡 Hint
Common Mistakes
Using firestore triggers instead of HTTP triggers.
Using database triggers for HTTP functions.
2fill in blank
medium

Complete the command to deploy all Firebase functions.

Firebase
firebase [1] --only functions
Drag options to blanks, or click blank then click option'
Adeploy
Bserve
Cinit
Demulators:start
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'serve' which runs local emulators.
Using 'init' which initializes a project.
3fill in blank
hard

Fix 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'
Ahttps.onRequest
Bdatabase.ref
Cfirestore.document
Dstorage.object
Attempts:
3 left
💡 Hint
Common Mistakes
Using database or Firestore triggers for HTTP functions.
Using storage triggers for HTTP functions.
4fill in blank
hard

Fill 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'
Aauth
Bfunctions
Cfirestore
Ddatabase
Attempts:
3 left
💡 Hint
Common Mistakes
Including functions emulator when not required.
Using database instead of firestore.
5fill in blank
hard

Fill 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'
AJavaScript
BTypeScript
CYes
DNo
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing JavaScript instead of TypeScript.
Skipping ESLint setup.
Not installing dependencies immediately.