Tell us what’s happening:
My code is not passing the test. The first two tests, adding Mongoose and MongoDB as dependencies is working, but the third test (“mongoose” should be connected to a database") is not passing. I have looked at several other people’s help posts and compared my code to what people have said works for them, and it still isn’t working.
Your code so far
package.json
{
"name": "fcc-mongo-mongoose-challenges",
"version": "0.0.1",
"description": "A boilerplate project",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"express": "^4.12.4",
"body-parser": "^1.15.2",
"mongodb": "^3.5.7",
"mongoose": "^5.9.9"
},
"engines": {
"node": "4.4.5"
},
"repository": {
"type": "git",
"url": "https://hyperdev.com/#!/project/welcome-project"
},
"keywords": [
"node",
"hyperdev",
"express"
],
"license": "MIT"
}
.env
My password is not ‘PASSWORD’ of course, just redacted for security.
SECRET=
MADE_WITH=
MONGO_URI="mongodb+srv://USERNAME:PASSWORD@cluster0-5rmcj.mongodb.net/test?retryWrites=true&w=majority";
myApp.js
const mongoose = require('mongoose');
mongoose.connect(process.env.MONGO_URI);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36
.
Challenge: undefined
Link to the challenge: