feat: dynamically set origin

This commit is contained in:
amhsirak
2024-12-03 21:24:50 +05:30
parent 52d9869b84
commit ed7690cb29

View File

@@ -99,7 +99,7 @@ app.get('/', function (req, res) {
// Add CORS headers
app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Origin', allowedOrigin);
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');
if (req.method === 'OPTIONS') {