4
votes

I have try to deploy cloud function to firebase but i am confused between command prompt and firebase console->project->functions. Because in command prompt display deployed successfully but in function tab there is no any functions.

I have follow below steps for deploy process

  1. Download a sample function and place to c drive with folder name AddMessage.
  2. Start command prompt and run "npm install -g firebase-tools"command.
  3. After that i have run "firebase login" command and result is you have already logged in with email.
  4. After that i have run "firebase init functions" command and give me project list and i have select a project with enter.And answer to some question that is in image.

    enter image description here 5.After that i have run "firebase deploy --only functions" command.and give me below result.enter image description here

After that i have visit to https://console.firebase.google.com/ in check in selected project -> function but i got below screen. enter image description here

1
I have also refer site for step : myhexaville.com/2017/03/22/firebase-cloud-functions - ashish
Your console output makes it look like you didn't actually deploy any functions. I would expect to see them individually named when you run the deploy command. - Doug Stevenson
i get cleanupUserData function from github.com/firebase/functions-samples/tree/master/… but i do not use node.js sdk is it possible? - ashish
Can you show me index.js? - Merlí Escarpenter Pérez

1 Answers

4
votes

Firebase only deploys functions that are exported, so you have to make sure that the function you want to deploy is exported in your index.js file:

exports.yourFunction = functions.https.onRequest((req, res) => {
// Your enter code here
}