Food Hunter
  • Introduction
  • Before installation
    • Prepare Firebase
    • Setup database
  • Admin installation
    • Import demo data
    • Deploy backend
    • Run local
    • Deploy frontend
  • Client app installation
    • About
    • Features
    • Connect with backend
    • Run app
    • Customization
    • Publishing
  • DEFINE BASICS
    • Adding users
    • Adding restaurant
Powered by GitBook
On this page
  • Activate functions service on Firebase
  • Set up a project
  • Deploy cloud functions
  • Adding host name for calling functions from front-end

Was this helpful?

  1. Admin installation

Deploy backend

Let's setup and deploy our cloud functions

PreviousImport demo dataNextRun local

Last updated 2 years ago

Was this helpful?

Activate functions service on Firebase

  • go to Functions in the left menu on Firebase

  • then start to use it by clicking «upgrade» button and then skip modal and click «purchase»

  • close modal

  • click «get started»

  • click «continue» in modal, click «finish» on next step in modal

Set up a project

Get your project id from settings of your Firebase project

Change project id in .firebaserc in default property to your project name from firebase project settings:

{
  "projects":
    {
      "default": "[PASTE YOUR PROJECT ID]"
    }
}

Deploy cloud functions

$ npm install -g firebase-tools

Then, move to functions folder:

$ cd functions

And make deploy:

$ firebase deploy --only functions

Adding host name for calling functions from front-end

Go to functions in Firebase and copy host name from function url.

Then, paste it into to hostname const:

src/config/config.ts

At first, let's setup firebase CLI as mentioned in :

You'll need a environment to write functions, and you'll need the Firebase CLI to deploy functions to the Cloud Functions runtime. For installing Node.js and , is recommended.

official docs
Node.js
npm
Node Version Manager
Paste to value of hostName