See the written version of this tutorial for links to prerequisites and related tutorials:
https://heynode.com/tutorial/overview...
With Node’s environment variables, we can configure our applications outside of our codebase. Environment variables provide information about the environment in which the process is running. We use Node environment variables to handle sensitive data like passwords, which we shouldn’t hard code, or configuration details that might change between runs, like what port a server should listen on. In Node.js these special variables are accessible on the global process.env object.
In this tutorial, we'll:
Learn what Node environment variables are, and when you should use them
Learn how to create and use Node environment variables
Learn how to configure your Node application to work with environment variables, including using .env files and the dotenv package
Show how to read and set environment variables with Node.js
Heynode.com: The best online Node.js courses and tutorials to help you solve hard problems fast.