Set environment variable for build in Netlify

后端 未结 6 1116
隐瞒了意图╮
隐瞒了意图╮ 2020-12-03 05:52

I\'m trying to set an environment variable for an API key that I don\'t want in my code. My source javascript looks something like this :

.get(`http://api-ur         


        
6条回答
  •  青春惊慌失措
    2020-12-03 06:09

    if you go to corresponding site's settings in Netlify, under build&deploy you can find a section called environment variables you can easily add your environment variables from there. if you add MY_API_KEY variable to environment variables you will be able to access it inside your project via process.env.MY_API_KEY.

提交回复
热议问题