In order for the application to use Atlas, you will need a file called .env to contain the connection information. In the mflix-js directory you can find two files, dotenv_unix (for Unix users) and dotenv_win (for Windows users).
Open the file for your chosen operating system and enter your Atlas SRV connection string as directed in the comment. This is the information the driver will use to connect. Make sure not to wrap your Atlas SRV connection between quotes:
MFLIX_DB_URI = mongodb+srv://…
It’s highly suggested you also change the SECRET_KEY to some very long, very random string. While this application is only meant for local use during this course, software has a strange habit of living a long time.
When you’ve edited the file, rename it to .env with the following command:
mv dotenv_unix .env # on Unix ren dotenv_win .env # on Windows
Note: Once you rename this file to .env , it will no longer be visible in Finder or File Explorer. However, it will be visible from Command Prompt or Terminal, so if you need to edit it again, you can open it from there:
vi .env # on Unix notepad .env # on Windows
In the mflix-js directory, run the following commands:
install MFlix dependencies npm install # start the MFlix application npm start
This will start the application. You can then access the MFlix application at http://localhost:5000/.