After years, I still come back to your videos. Doesn't matter which one. I just come back to them. They solve so many issues. When I first discovered you I wasn't working with JS at all. But enjoyed watching your videos. Now I am working with JS. So I am back
@janetrajkoski14243 жыл бұрын
As someone who just started learning to code and my first interview being: "The hell you doing your API key is public", this was a godsend video. Very to the point and clear explanation. Subscribed
@simonmafanye.3537 Жыл бұрын
Watched your video for 5minutes and i have no choose but to hit the Subscribe button very fast. I love your style of teaching,
@PROTOTYPZ4 ай бұрын
Just found this guy's channel and he cooks, simple easy to understand instructions, great job to the creator! Always going to check your channel for any information I need before others.
@hj1916 Жыл бұрын
It was never boring! Actually, you made this serious topic so fun like magic. Also, I loved the ending credit of the train. Creative idea!!! Thank you so much!!!!
@SaiKumar-vf9lz4 жыл бұрын
From hiding api keys to adding local source to GitHub ..well summarized things in 10 mins ..great video !
@MrGreg5572 жыл бұрын
What a great series man, I'm grateful everyone can use resources like this. Going from knowing almost 0 JS to deploying my app was very satisfying. One update though: if you get this error like me: "npm ERR! Missing script: "start"", add this to the end of your package.json file, before the finishing curly brace: ,"scripts": { "start": "node index.js" },
@CodeBUNNY3 ай бұрын
it's been years and i still love your content.
@smashing_data429211 ай бұрын
As someone who has done this before on my own projects I can say this is legit. Immediate subscribe.
@aristotleanderson9304 жыл бұрын
This is a great tutorial! Thank you for being quick and to the point, as well as informative and helpful!
@gustavotomas52143 жыл бұрын
You probably dont give a damn but does someone know a way to log back into an instagram account? I somehow forgot my account password. I love any help you can give me.
@casenace57223 жыл бұрын
@Gustavo Tomas Instablaster :)
@gustavotomas52143 жыл бұрын
@Casen Ace thanks so much for your reply. I found the site thru google and Im waiting for the hacking stuff now. Seems to take a while so I will reply here later when my account password hopefully is recovered.
@gustavotomas52143 жыл бұрын
@Casen Ace It did the trick and I finally got access to my account again. I am so happy! Thank you so much, you really help me out!
@casenace57223 жыл бұрын
@Gustavo Tomas no problem =)
@zeyadahmedsamer34432 жыл бұрын
no words can describe your awesome explanation
@honeybcomb4 жыл бұрын
I randomly came across this video and I can't go without thank you ! Your explanations are very clear and makes the course material simple to understand. Thank you very much ! I am so happy I fond your channel today :))
@moaazbhnas8864 жыл бұрын
I was searching for a video about env file and felt relief when I saw yours
@aakash-codes Жыл бұрын
I just love the way you teach things! Doesn't even let me feel boring for a single sec! 😊🚀
@zwlw2 жыл бұрын
you're a legend dude this is a life saver
@Rlc2014 жыл бұрын
How i didn't know this channel? Awesome tutorial and one of the best teachers that i have ever seen on youtube. Keep up!
@bandarabdullah405 жыл бұрын
I was suffering to understand the environment variable and its benefits this video the best explanation I have ever seen.
@arshamazami1594 жыл бұрын
The best video about environment variable and how to use them👍👍👍
@Niehde5 жыл бұрын
Nice video! I've just recently pushed some API keys to Github. Fortunately they have a service that lets you know when you've screwed up.
@amjedbouhouch79934 жыл бұрын
Same 🤣🤣
@kareng94845 ай бұрын
Bro, thank you very much, this is exactly what I needed, you're so good at explaining things
@kingsley31943 жыл бұрын
Thank you so much. You saved my day with this explanation
@benSfft4 жыл бұрын
Thanks a lot ! That's clear and the objectives are so well explained ! I didn't even know that we could code on ecstasy !
@tegaogheneovo58813 жыл бұрын
So keep working on my project and when I want to deploy hide all my keys and db names thank you 😁
@SnobbyLion Жыл бұрын
You're so good at explaining things! Thank you!
@kenfeier5542 Жыл бұрын
Great tutorial, but I do want to mention one thing. Environmental variables help you hide your sensitive information for version control purposes. If you build a public website and have environmental variables showing on client side, a user can open the debugger and hover over those variables and see the values of them. Make sure that you use these variables on back-end (server) side if you don't want anyone to see their values.
@snehagangurde62664 жыл бұрын
Thank you so much i have been searching one good video for days. finally got this one. this one is quick, understandable
@JanacMeena2 жыл бұрын
2:00 start 5:30 Create a sample .env Make sure .gitignore has .env listed
@nofacee945 жыл бұрын
If your file is called index.js, you can just do `node .` or `node index`
@DigitalMonsters5 жыл бұрын
Whats the difference between using dotenv and just throwing them in another javascript file that you export from and then adding that file to the gitignore? I could watch the video and most likely get the answer to that question; but in the interest of being one of the earliest comments.... please understand.
@ridespirals5 жыл бұрын
kind of the same thing, but environment variables are more common because you can configure them more easily on other host services like heroku, CI systems like Jenkins, you can change then on a command line, lots of other ways.
@BertMaurau5 жыл бұрын
Waiting for the actual answer, but like for me, my main reason for using .env files is because it's a "standard" and you can share that file between different languages for example. A single .env file can be read in NodeJS, PHP, Python,... (others?) without changing any syntax and let dotenv handle everything. My second reason would be the "environment" part. It's clear that it is environment-based and the scope for these variables is globally accessible (less an issue in NodeJS probably) within classes, methods, ..
@johncerpa37825 жыл бұрын
Ahh true that
@Loppy23455 жыл бұрын
For the same reason you wouldn't take a helicopter to do your grocery shopping, it's not the right tool for the job.
@220syedrazamehdirizvi77 ай бұрын
U made it so fun to watch ....❤
@leerenae3133 жыл бұрын
Hey, love your videos! they're so straight to the point Thank you for putting this out for free 🙏
@bacanalienigena2 жыл бұрын
It works amazingly, thanks a million!
@akhilyadav74265 жыл бұрын
Please publish the continued episode fastly sir waiting for it A subscriber from INDIA #Codingtrain
@skrillex153 жыл бұрын
Thanks for this playlist. Really helped
@danieloliveira98154 жыл бұрын
Typing those command line commands made me feel like a real programmer 😎 Thank you for this awesome playlist!
@pjguitar153 жыл бұрын
You're a great teacher!!!
@lorisp1862 жыл бұрын
Thank you man, I was exactly looking for that
@drhastings3 жыл бұрын
Simple and straight to the point thank you👏🏿
@sweickel3 жыл бұрын
Thank you! This is exactly the video and explanation I needed!
@noco26052 жыл бұрын
Thank you very much for your explanation 😊
@dennisgonzales95213 жыл бұрын
Very engaging! thank you for the lesson.
@nighknight90124 жыл бұрын
if you are working on linux you may experience a problem when running the code, "undefined" gets returned, thats because you need to set the env variable yourself. go to bashrc and do export ENV_VARIABLE=VALUE no spaces around the equal and if the VALUE has spaces add quotes around it
@ousmaneyadely5 жыл бұрын
Thanks a lot! I was totally stuck with a bug until I watched your video. So clarifying!
@zensic2 жыл бұрын
Thank you! Was just looking for this
@adedimolao90944 жыл бұрын
can you use .env and gitignore in a vanilla js project?
@familyjuega123453 жыл бұрын
Awesome content and explanation, thanks man!
@edwincaceresi.32843 жыл бұрын
Thanks! It was very clear!
@hargur41212 жыл бұрын
Thanks a lot! This has been a lifesaver
@santra5284 жыл бұрын
Using dotenv package and store the API_KEY in .env file does not completely hide the API_KEY. It is fine for GitHub because someone visiting this repo they wont be able to see the API_KEY. But if the project is deployed in sever then anyone can see the API_KEY from the browser when they visit this particular website. The best way to hide the API_KEY is store it in the backend and make the API calls from the backend only. Only send the response data to the frontend. And to add more security you can set up CORS for the API_KEY so even if someone gets access to the API_KEY they wont be able to send request as the request will be rejected and only the request from the domains mention in the CORS will be able to make successful request using this API_KEY.
@incandescentbruh3 жыл бұрын
No one is dumb enough to put the api key in frontend, also the example code in the video is using express js which is run by node js in backend.
@sharadsharma31765 жыл бұрын
eagerly waiting for the next video of this series.... I want to know more about the available hosting services for node.
@ncpurge7894 жыл бұрын
THIS SAVED MY LIFE THANK YOU
@ivankljun25424 жыл бұрын
Very nice, thank you, very educational and entertaining! :)
@Cam-lm6wo3 жыл бұрын
incredible video, I spend like 1 year in a College trying to use GitHub as they told me without actually know what I was doing. thank you! Just a question... Can I add to the .env file a private key from firebase?
@appiahseth53194 жыл бұрын
Great presentation. Thank you very much
@oyetorostephen50105 жыл бұрын
THank you! I find this fun to learn
@mohammedraqeeb43923 жыл бұрын
Great explanation
@zorro1rr4 жыл бұрын
I'm getting the api key returned in my terminal, but now my data is not being returned in the browser and getting console error: Uncaught ReferenceError: require is not defined. Help please
@TheCodingTrain4 жыл бұрын
Our Coding Train Discord is a great place to get help with coding questions ! discord.gg/hPuGy2g - The Coding Train Team
@RayfranRocha4 жыл бұрын
Spectacular tutorial! Thank you. It's very clear. I wonder if using any browser inspector, can anyone see the API_KEY? Looking inside the code or in the Request to the API message?
@aham36875 жыл бұрын
could continue this series with PWA. This has been popular with web technology in this modern day.
@bluemagicuk5 жыл бұрын
super helpful - thank you!
@GabrielTobingАй бұрын
Here after learning developers added the api key and people were able to view it in the git history commit before it was published XD
@santiagootero35809 ай бұрын
you are the goat, thanks so much
@Symparanekromenoii4 жыл бұрын
So, so useful. Thanks!
@abigiyatadesse26722 жыл бұрын
Thanks so much this is helpful.
@nicetomeetugaming70242 жыл бұрын
Amazing video sir!
@LimitlessGamingYoutubeChannel3 жыл бұрын
Super helpful video!
@DieHard889134 жыл бұрын
Thank you! this helped me a lot, earned a new sub :D
@xtree28172 жыл бұрын
I exactly landed where i wanted to be. I was just looking for this
@techmarinar3 жыл бұрын
thanx man , this was helpful
@Philson2 жыл бұрын
Is it secure deploying it tho
@ilearncode73652 жыл бұрын
From a “security/ privacy” standpoint, how is this any better than just having a js file with a variable for thr api key in it?
@devinschlegel17635 жыл бұрын
his next coding challenge should be solving the heat equation based off of 3blue1brown's video on the same topic
It says require is not defined for me in the console. I followed the steps in terminal, have the lastest version of node etc.???
@tannermartz67613 жыл бұрын
same ugh this is so annoying
@dreznik5 жыл бұрын
sheefmahn brilliant series of videos. any videos where you interact with a Database-as-a-Service? SQL or not
@nicetomeetugaming70242 жыл бұрын
BTW you are amazing teacher!
@abhishektyagi44285 жыл бұрын
Sir Could you please make a video explaining the resources you use to learn or enhance your programming skills
@weixiangng82794 ай бұрын
If I were to deploy to vercel how can I retrieve the .env values?
@Vincetroid4 жыл бұрын
You saved me, suscribed!
@serdarinjo2 жыл бұрын
Muchas gracias bro 😀!
@patrickporter64413 жыл бұрын
I had a question: Can the same effect be accomplished with a config.json and including that in the gitignore?
@Jb679124 жыл бұрын
you don't need an access token for the logs js file? It seems the website of mapbox requires one
@akramsyed36282 жыл бұрын
i am first here and very impresed they way you teach , ke
@carlosduque87673 жыл бұрын
Why when you put the node_modules in the .gitignore file you put a / in front of it?
@dusanlukic67842 жыл бұрын
because node modules is a folder and then git will ignore every file in that folder
@lochsandro4 жыл бұрын
Nice video!!! How to use this environment variables in the CI(actions)?
@sazaam4 жыл бұрын
Simply awesome
@MuhammadRizky-ub3oy2 жыл бұрын
i love your energy
@GopalChand Жыл бұрын
Hi, how about if i am using Docker and dont want to publish my .env file in git. But my application is require env file. Can you pls help how to use .env file in Docker container or K8
@kritikshivanshu4 жыл бұрын
@TheCodingTrain Hi there! I am facing problem in order to upload .env file in my github repo. Since the application doesn't fetching information. What to do???Please help me.
@michaelroysomera10684 жыл бұрын
Is this supported in Angular?
@lilynn77779 ай бұрын
Great Tutorial! Although i have a question and i hope some good soul will answer me. During my Bootcamp, we never got tought or warned to hide our API Keys. So now that i am about to apply for jobs, i have been overwhelmed with the fact that i need to hide my personal API key that i used for my projects (it's a free personal key from my bootcamp). So my question is: What should i do that i already committed and publicly pushed all of my projects and API keys on my github? Thankfully no one has access to it yet but i need to take action before sending applications or post my github to Linkedin. Any advice would be greatly appreciated 🙏🙏
@notprivy3 жыл бұрын
I see that we can do without require by using node -r. Can you explain how to do it?
@michaelamay97144 жыл бұрын
require('dotenv').config is a sever-side technology not a browser, hence, I am getting an error on my console. How are you not getting this error?
@githinjohny3413 Жыл бұрын
did u end up fixing it?
@kwameagyenim-boateng29683 жыл бұрын
console.log(process.env) doesn't include my .env variable
@gideonaswani24492 жыл бұрын
Awesome, thanks
@Viralplace4 жыл бұрын
but this works just for development on github... if I go in production like a jam stack project? it is not hidden right?
@ankurkhandelwal13753 жыл бұрын
What if index.js and .env are in different folders?
@ashy71982 жыл бұрын
are .env not rendered to the browser then or something? What is to stop someone from viewing the app in their browser and fetching your API key out of the rendered JS with inspect element?
@TheCodingTrain2 жыл бұрын
That is correct! The way I've set up this project the .env files are hidden on the server. You can only see them if you have login access to the server where they are held.
@BrianKiddDevDesign Жыл бұрын
@@TheCodingTrain Excellent. This was a very fun and informative series. Thanks.
@catalinhora64893 жыл бұрын
i'm working with custom-env pretty similar, but I need to have two env files, for two environments, how should this be treated? How can i make it work?
@catalinhora64893 жыл бұрын
Nevermind, got it :)))
@pepew71023 жыл бұрын
But your API key is still visible in the sources og the project right ?
@alejandrocano884 жыл бұрын
I have a react with typescript project and the console.log(process.env) works just fine without intalling 'dotnet' , perhaps this function is already implemented?
@nickspringer57554 жыл бұрын
Theres a SOLID chance dotenv is a dependency of CRA