how to test Cloud Functions for Firebase locally on pc

前端 未结 9 1487
耶瑟儿~
耶瑟儿~ 2020-11-27 16:39

Today Firebase released its brand new product Cloud Functions for Firebase and I just created a hello world function and deploy it on my existing firebase project.

I

9条回答
  •  孤城傲影
    2020-11-27 17:11

    Firstly, I suggest you to install following dependencies,

    npm install --save firebase-functions
    npm install -g firebase-tools 
    

    If already installed then you can update it to latest one. Generally, functions-emulator comes with above dependency but still I would recommend you to update it,

    npm install -g @google-cloud/functions-emulator
    

    Once it has been updated, go to functions folder of you application and run following command,

    firebase serve --only functions
    

    I hope it helps!

提交回复
热议问题