Problem setting up dotenv_windows.env

I’ve got a problem reading the dotenv_windows.env file. I’m running Windows 10, Node 11.0.0 and NPM 6.4.1. After I set the environment variables MFLIX_DB_URI and MFLIX_NS in windows I was able to successfully connect to the application. Running the below .env file didn’t work. I used the same cluster address (not shown below) in my .env file as I used setting up the environment variables. I don’t think dotenv is reading my dotenv_windows file. Any ideas what may be wrong.

Ticket: Connection

Rename this file to .ini after filling in your MFLIX_DB_URI and your SECRET_KEY

Do not surround the URI with quotes

SECRET_KEY=super_secret_key_you_should_change
MFLIX_DB_URI=mongodb+srv://m220student:m220password@/mflix?retryWrites=true
MFLIX_NS=mflix
PORT=5000

1 Like

What do you mean running the .env file?

This file is not meant to be run. It is a configuration for the rest of the system.

You want to make sure you rename the dotenv_windows file to .env. As @steevej-1495 said, once you make that change and have the variables within configured there’s nothing more to do with the file as it’s read in for configuration only!

Right, stupid mistake. I just changed the file name dotenv_windows by adding a .env extension. When I should have renamed the file to .env .