Is it possible to store a JSON file to an ENV variable with dotenv?

后端 未结 2 1678
鱼传尺愫
鱼传尺愫 2021-02-14 22:55

I am using Google Drive API with my Rails application. The API is working fine. I have the following client_secret.json file:

{
  \"type\": \"service_account\",
         


        
2条回答
  •  长发绾君心
    2021-02-14 23:30

    Yes. It is possible to store json file in variable. However there is one small change needed :

    \\\"type\\\": \\\"service_account\\\",
    

    Do this for every double quote inside the curly braces of json.

提交回复
热议问题