Environment variables allow you to define secure variables that can be added to your local project or container. In this video, take a closer look at some different ways of using environment variables in a .env file and with the dotenv npm package.
or operating system. … Every operating system has a solution … for environment variables. … I just set an environment variable. … is with echo dollar sign node underscore env … and we see that we have development. … Environment variables are really important for security. … So instead of hard coding security information … directly into our source code, … we can use environment variables … and references them at runtime. … For example, let's say I export my API key. … So I can export my API key. … So here's the secret key, abc123 … So what I can do , within my node js files, … I'll create a new file over here in a blink start folder. … I can references those variables on the process.env object. … So let's go ahead and run our file, node dot … So that's going to go ahead and run that index.js … and we can see the values for our environment variables. … So we can use these invariables at runtime … like let's say I wanted to check … to see if the node environment was equal to development. …
- Making HTTP requests
- Building web and file servers
- Installing packages with npm
- Managing and linking global packages
- Working with Express, the web server framework
- Handling POST and DELETE requests
- Creating WebSockets
- Testing and debugging Node.js code
Skill Level Advanced
Node.js: Real-Time Web with Socket.IOwith Emmanuel Henri1h 24m Intermediate
Work with VSCode1m 59s
1. The HTTP Module
3. Web Servers
5. Node.js Testing
6. Automation and Deployment
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.