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!