4

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

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
ashish
  • 848
  • 6
  • 16

1 Answers1

4

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
}
Kukic Vladimir
  • 1,010
  • 4
  • 15
  • 22
LambdaDigamma
  • 117
  • 1
  • 8