WhatsApp-Clone-Tutorial
WhatsApp-Clone-Tutorial copied to clipboard
Step 15 Use environmental variables for the Unsplash API key
I think it should be a nice thing to explain to the user what are Environmental Variables and how to create and use a .env
file in the application and change the current way the Unsplash API key it's used
headers: {
Authorization:
'Client-ID 4d048cfb4383b407eff92e4a2a5ec36c0a866be85e64caafa588c110efad350d',
},
EDIT
This course is so extensive and full of teachings that I forgot that the .env
file is actually explained in Step 3 > Client 3.1
So maybe just create one for the server and add the Unsplash API key to it?
@reymon359 are you up for a PR to change it how you see fit?
Sure, I could find some time and work on it!
I was thinking of changing it to:
headers: {
Authorization:
`Client-ID ${process.env.UNSPLASH_ACCESS_KEY}`,
},
Although it could also be added in the env.ts file and then import it here.
What do you think?
mmmm not sure, I'll leave it to your call!
Hi there! Sorry for the late response but I have been quite busy the last weeks. I submitted a pull request #84 to implement it. I tried to change the code too but when I click the submit button I am being redirected to a not working link.
I opened an issue to take it into account #85