This is not my first time posting here about an .env file that is not working properly. I’m doing the Implement the Serialization of a Passport User challenge in the Quality Assurance - Advanced Node and Express Cert.
I’m getting this error when running the server:
MongoParseError: URI malformed, cannot be parsed
I’ve followed the steps in this post with the same issue: MongoParseError: URI malformed, cannot be parsed and still the same.
I’m also getting this in the console:
express-session deprecated req.secret; provide secret option
Error: secret option required for sessions
This is my .env file, which as far as I know it is correct:
PORT=8080
NODE_ENV=development
MONGO_URI=mongodb+srv://boss:freecodecamprules@cluster0.ovatf.mongodb.net/dbname?retryWrites=true&w=majority
SESSION_SECRET=shhhh
(I had to delete the sample.env file that came with the boilerplate because Replit didn’t allow me to rename it to .env and add a new file named .env)