How do I add API keys and other secure stuff to heroku?

前端 未结 2 1298
清酒与你
清酒与你 2021-02-09 18:41

I read somewhere but cannot seem to find where to add secret keys into Heroku without needing to put it into the source code git repository?

I guess that helps keep it s

2条回答
  •  鱼传尺愫
    2021-02-09 19:00

    http://docs.heroku.com/config-vars

    Then add the development keys to an initializer:

    #config/initializers/keys.rb
    
    development:
      SOME_KEY = 'abc123' #not your production key
    
    testing:
      SOME_KEY = 'abc123' #not your production key
    
    #production:
      #blank
    

    Optionally add the initializer to .gitignore. Not required as your production key isn't stored.

提交回复
热议问题