I have tired to pass the Install and Set Up Mongoose fCC test, but replit.com dont allow me to create .env file, so instead I used their create secret.
Please note: Whilst this does very-well work, it is a security risk you should not be taking. You are responsible for your database account, and with the URI, anyone can read/write to your database.
This is dangerous because:
a) If you have your credit card linked to your account, and someone starts spamming the database, you could be charged for the excessive requests - this has cost people thousands of USD worth in a single day.
b) If someone uses your database account to host/upload illegal material/data, you could be liable.
If you are unaware, all Replit projects are public, and the URL is easy to find. I am aware of bots roaming GitHub for unsuspecting devs who have accidentally publicised their secrets. So, it does not take a stretch of the imagination to assume there are similar bots on Replit.
It is unfortunate that the change in Replit’s layout/workspace has caused issues with the secrets/environment-variables, and, once we have a sure way to get around this - or Replit make changes - we will let people know.
My advice is:
Do not leave your key anywhere public
Change your database password
Use another service which works better with environment variables (e.g. Glitch, Codesandbox, or locally (does not work for projects, but does for these lessons))