Food Hunter
Search…
Deploy backend
Let's setup and deploy our cloud 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:
1
src/config/secret.ts
Copied!
Paste to value of hostName

Deploy cloud functions

At first, let's setup firebase CLI as mentioned in official docs:
1
$ npm install -g firebase-tools
Copied!
You'll need a Node.js environment to write functions, and you'll need the Firebase CLI to deploy functions to the Cloud Functions runtime. For installing Node.js and npm, Node Version Manager is recommended.
Then, move to functions folder:
1
$ cd functions
Copied!
And make deploy:
1
$ firebase deploy --only functions
Copied!
Last modified 6mo ago