Skip to content

Commit

Permalink
Fix CORS issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishraj09 committed Nov 11, 2024
1 parent f384095 commit e81aecd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ console.log(`Development mode: ${isDev}`);
console.log(`Origin URL: ${originUrl}`);

const mongoUri = isDev ? "mongodb://localhost:27017/iptvnator" : process.env.MONGO_URI || "";
const dbName = isDev ? "iptvnator" : process.env.MONGO_DB_NAME || "";
const collectionName = isDev ? "playlists" : process.env.MONGO_COLLECTION_NAME || "";
const dbName = isDev ? "iptvnator" : process.env.MONGO_DB_NAME || "iptvnator";
const collectionName = isDev ? "playlists" : process.env.MONGO_COLLECTION_NAME || "playlists";
let databaseService;

if (!mongoUri || !dbName || !collectionName) {
Expand All @@ -29,7 +29,6 @@ if (!mongoUri || !dbName || !collectionName) {
databaseService = new MongoDBService(mongoUri, dbName, collectionName);
}


const corsOptions = {
origin: originUrl,
optionsSuccessStatus: 200,
Expand Down

0 comments on commit e81aecd

Please sign in to comment.