Where is or What is the serviceAccountKey.json is the node js sample of firebase realtime database

前端 未结 4 491
悲哀的现实
悲哀的现实 2021-01-18 16:26

I have downloaded the zip of Firebase real-time database node.js sample and navigate to the database section

https://github.com/firebase/quickstart-node

4条回答
  •  -上瘾入骨i
    2021-01-18 16:52

    1. require('path/to/serviceAccountKey.json') means - call this file to be used in the file you are calling it

    2. serviceAccountKey.json is a file that you have to generate

    3. If you look at this page 'Add Firebase To Your App' https://firebase.google.com/docs/ios/setup under 'Add Firebase to your app' - it says Navigate to the Service Accounts and generate a new private key, doing this will generate what will be your 'serviceAccountKey.json' file after you rename it

    4. place that file in the directory of your choosing local to your cloud code directory, have a look at this comment https://stackoverflow.com/a/42634321/2472466 for more insight into step 4

提交回复
热议问题