Full-Stack Firebase
  • Introduction
  • Introduction
    • Full-Stack Firebase
    • Why Firebase?
    • What is serverless?
    • Prerequisites
    • Overview & Structure
    • Write your first query
    • Links
    • Downloadable Notes
  • Firebase Console
    • Introduction
    • Walkthrough
  • Firebase Tools
    • Introduction
    • Walkthrough
  • Firebase Authentication
    • Introduction
    • Walkthrough
    • Challenge
    • Notes
  • Cloud Firestore
    • Introduction
    • Walkthrough
    • Security Rules
    • Indexes
    • Challenge
    • Notes
  • Realtime Database
    • Introduction
    • Walkthrough
    • Security Rules
    • Challenge
    • Notes
  • Cloud Functions for Firebase
    • Introduction
    • Walkthrough
    • Challenge
    • Notes
  • Firebase Storage
    • Introduction
    • Walkthrough
    • Security Rules
    • Challenge
    • Notes
  • Cloud Messaging
    • Introduction
    • Walkthrough
    • Challenge
    • Notes
  • Firebase Hosting
    • Introduction
    • Walkthrough
    • Challenge
    • Notes
Powered by GitBook
On this page
  • Cloud Functions
  • Find the repo
  • Localhost installation
  • Edit environment files
  • Run the tests
  • Complete the challenge
  1. Cloud Functions for Firebase

Challenge

PreviousWalkthroughNextNotes

Last updated 6 years ago

Cloud Functions

Find the repo

We'll be working on a branch of our repo named .

Localhost installation

Pull directly from GitHub...

git clone https://github.com/how-to-firebase/firelist-react.git
cd firelist-react
git checkout challenge-functions

Edit environment files

Update the following files with your own project details:

  • /.firebaserc

  • /public/environments/environment.dev.js

  • /public/environments/environment.js

  • /functions/environments/environment.dev.js

  • /functions/environments/environment.js

Run the tests

Once you're on the branch, make sure to run yarn or npm install to get your Node.js dependencies.

Then cd into your functions directory and run yarn or npm install again.

Use nvm install 6.14.2 then nvm use 6.14.2 to switch to Node version 6.14.2.

The Node version is important to make sure that your tests run in an identical environment to that of the Cloud Functions runtime.

Then run yarn test or npm test to run your tests.

yarn
cd functions
nvm install 6.14.2
nvm use 6.14.2
node --version //should read out 6.14.2
yarn test

Complete the challenge

Search the codebase for Challenge Functions to find all of the challenges.

Work through the challenges in order from 01 to 06

Make sure that you've installed , or some other tool to switch between Node.js versions.

firelist-react
challenge-functions
the repo
nvm for Linux/macOS
nvm for Windows