How to use Google API credentials json on Heroku?

后端 未结 10 1437
深忆病人
深忆病人 2020-12-03 05:36

I\'m making an app using Google Calendar API, and planning to build it on Heroku.
I have a problem about authentication. Usually I use credential json file for that, but

10条回答
  •  长情又很酷
    2020-12-03 06:28

    you can change the scripts like this in your packge.json, set the file json path in GOOGLE_APPLICATION_CREDENTIALS

    "scripts": {
        "start": "GOOGLE_APPLICATION_CREDENTIALS=./yourfile.json node app.js"
      }
    

提交回复
热议问题