Skip to content

Commit

Permalink
fix to cors
Browse files Browse the repository at this point in the history
  • Loading branch information
ushliypakostnik committed Sep 20, 2019
1 parent 9485532 commit e54c461
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ db.on('error', console.error.bind(console, 'MongoDB connection error:'));

// CORS
if (config.CORS_ENABLED) {
app.use(cors());
const corsOptions = {
credentials: true,
origin: function (origin, callback) {
callback(null, origin);
}
}

app.use(cors(corsOptions));
}

// Static
Expand Down

0 comments on commit e54c461

Please sign in to comment.