How to Hide API Keys with Node JS - Environment Variables & .env

How to Hide API Keys with Node JS - Environment Variables & .env

Monsterlessons Academy

2 года назад

12,208 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

RabidWolf
RabidWolf - 06.10.2023 19:29

Thanks for the explanation. I think I understand now. In terms of I thought this did something, it doesn't.
So when you port your code to production - you must also port your .env as well.
Only I ported my code to a server and one day noticed the server owner was looking at my source files.
This isn't going to stop them reading the sensitive details from the .env file, is it.
I just need to pick a better server provider.

Ответить
VoxKeKw
VoxKeKw - 04.09.2023 18:00

First of all that is a great video, secondly dude you don't use mouse I want to get to that point

Ответить
511 Sanjeev Thalod
511 Sanjeev Thalod - 02.08.2023 14:27

When i push my code to github without .env file and then i decide to host it using render, since there is no .env file how will code get my api key

Ответить
Code Snippet
Code Snippet - 24.06.2023 03:51

Thank you! Quick and on point

Ответить
AMG
AMG - 15.04.2023 22:10

This is my 3rd video on env files and I do not know how will another person use my project after cloning from github if i have ignored the .env??? will he need to manually look for each and every variable manually???

Ответить
Oleksandr Mykhailov
Oleksandr Mykhailov - 30.09.2022 21:34

супер тутор! дякую

Ответить
BGivo
BGivo - 08.09.2022 21:58

How would this work with front-end code? Wouldn't all of our API KEYS get exposed in the browser anyway once they are loaded from the .env file?

Ответить
Leonardo Pillay
Leonardo Pillay - 23.08.2022 17:26

Hi there. So I'm sure that you know in angular we have the environment.ts file which is where I store the API keys (as I was taught). Today I was checking something in the network tabs in chrome and to my amazement, I saw the API key under one of the API calls. Can you explain why this is the case or how to prevent it? Thanks!

Ответить
Cristian Metz
Cristian Metz - 06.04.2022 15:37

i arrived here too late...lol, time to generate another API key and get secured. Thanks for the info! - subbed.

Ответить
Ranjeet kumar
Ranjeet kumar - 25.03.2022 02:22

Hi! Thanks for the great Content. What if we want to do a post request with the data received from the user? How do i pass the data from user side to the proxy port(backend)?

Ответить
mnky
mnky - 10.12.2021 20:38

Great video as always! So as I understood, we should never ever write sensitive information on the frontend side, including frontend code of the mobile app as well, right?

Ответить
John
John - 09.12.2021 22:58

A good idea I read about was to create a .env.example file. It is a copy of the .env but without the values.
So, for example, you will have API_KEY=add your api key here.
The developer then uses this as the template for their own .env adding in their own settings.

Ответить
rihard
rihard - 09.12.2021 20:24

Always very good

Ответить
Agustin Rodriguez Dei Rossi
Agustin Rodriguez Dei Rossi - 09.12.2021 19:01

Nice video!! can you do a video about environments in Angular? <3

Ответить