Installing and Setting Up Mongoose

Hey Guys!
I’m stuck in this course (edit: https://www.freecodecamp.org/learn/apis-and-microservices/mongodb-and-mongoose/install-and-set-up-mongoose) because FCC isn’t capable to check
// running tests
“mongodb” dependency should be in package.json
“mongoose” dependency should be in package.json
“mongoose” should be connected to a database
// tests completed
I’d added
"fcc-express-bground": "https://github.com/freeCodeCamp/fcc-express-bground-pkg.git"
to the package.json and also,

if (!process.env.DISABLE_XORIGIN) {
  app.use(function(req, res, next) {
    var allowedOrigins = ['https://narrow-plane.gomix.me', 'https://www.freecodecamp.com'];
    var origin = req.headers.origin || '*';
    if(!process.env.XORIG_RESTRICT || allowedOrigins.indexOf(origin) > -1){
         console.log(origin);
         res.setHeader('Access-Control-Allow-Origin', origin);
         res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    }
    next();
  });
}

const port = 3000;
bGround.setupBackgroundApp(app, myApp, __dirname).listen(port, function(){
  bGround.log('Node is listening on port '+ port + '...')
});

All work fine on the browser.
Anyone can help me?
Thanks!

Welcome, gonchileon.

I have moved your post to a new topic, because it involves your own project/issue, and the thread you replied to was old/outdated.


Would you mind sharing a link to your project code? It is difficult to see what is going on with the current code.

1 Like

Thanks!
Here is: https://repl.it/join/sovnkxgo-gonzalolen

Doesn’t look like the correct starter project

Here is the starter project link from the intro page
https://repl.it/github/freeCodeCamp/boilerplate-mongomongoose

1 Like

I tried with that starter project, and it works.
I’ll compare with mine and check why didn’t work.
Thanks!