Connecting to the Mongo Atlas database – Part 3
Setup the following folders and files as shown
(Environment variables are key-value pairs that can affect how running processes will behave on a computer. They
are beneficial to keep specific configura ons separate from your applica on code, such as database connec ons or
external service creden als. Using environment variables ensures you can maintain security by not hardcoding
sensi ve informa on, allowing greater flexibility across different environments.) Visit website such as https://
jwtsecret.com/generate to obtain a strong Secret and also mongoDB to get the connection string
Lets check our nodejs app connection to the Mongol Atlas DB. You should see the
output “Mongo connected” in the terminal if your connection from your Nodejs App to
CloudAtlas MongoDB server is successful.
node server.js