Sindbad~EG File Manager
const whiteList = [
"https://www.google.com",
"https://crmapis.grandunicornhotels.com",
"http://www.firefox.com",
"http://localhost:3000",
"http://localhost:3001",
"https://auction-flow.com",
"https://auction-sync.com",
];
const corsOptions = {
origin: (origin, callback) => {
if (whiteList.indexOf(origin) !== -1 || !origin) {
callback(null, true);
} else {
callback(new Error("Not allowed by cors"));
}
},
methods: "GET,HEAD,PUT,PATCH,POST,DELETE",
credentials: true,
exposedHeaders: ["Content-Length", "X-Foo", "X-Bar"],
optionsSuccessStatus: 200,
};
module.exports = corsOptions;
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists