Access to XMLHttpRequest at 'https://freecodecam-boilerplate-db6u1l9eia8.ws-us116.gitpod.io/_api/is-mongoose-ok' from origin 'https://www.freecodecamp.org' has

Hi, I am looking for help with the failing test case below for exercise at https://www.freecodecamp.org/learn/back-end-development-and-apis/mongodb-and-mongoose/create-a-model

Failing test case ----> Creating an instance from a mongoose schema should succeed. <—

This is pre-included in ther server.js file setup by freecodecamp project -

const enableCORS = function (req, res, next) {
if (!process.env.DISABLE_XORIGIN) {
const allowedOrigins = [“https://www.freecodecamp.org”];
const origin = req.headers.origin;
if (!process.env.XORIGIN_RESTRICT || allowedOrigins.indexOf(origin) > -1) {
console.log(req.method);
res.set({
“Access-Control-Allow-Origin”: origin,
“Access-Control-Allow-Methods”: “GET, POST, OPTIONS”,
“Access-Control-Allow-Headers”:
“Origin, X-Requested-With, Content-Type, Accept”,
});
}
}
next();
};

My solution adds the following:

mongoose.connect(process.env.MONGO_URI, {
useNewUrlParser: true,
useUnifiedTopology: true
});

const personSchema = new mongoose.Schema({
name: {
type: String,
required: true
},
age: Number
})

const Person = mongoose.model(‘Person’, personSchema);

Error: Access to XMLHttpRequest at ‘https://freecodecam-boilerplate-db6u1l9eia8.ws-us116.gitpod.io/_api/is-mongoose-ok’ from origin ‘https://www.freecodecamp.org’ has been blocked by CORS policy: No Access Control Allow Origin header is present on the requested resource

You have to submit the URL from the preview window, the one that starts with 3000-

Also, your schema is incomplete. It is missing the favoriteFoods string array.