Skip to content

Commit 1f3038c

Browse files
Chandan SMChandan SM
Chandan SM
authored and
Chandan SM
committed
Reverted Changes
1 parent ffb6d42 commit 1f3038c

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

Diff for: score_keeper_server/server.js

+1-19
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,15 @@ const ProductData=require("./modals/productData")
88
const News = require("./modals/news");
99
const cron = require('node-cron');
1010
const axios = require('axios');
11-
const whitelist = ['https://score-keper.netlify.app'];
1211

1312
// Create an Express app
1413
const app = express(
15-
{cors:{origin: function (origin, callback) {
16-
if (whitelist.indexOf(origin) !== -1) {
17-
callback(null, true);
18-
} else {
19-
callback(new Error('Not allowed by CORS'));
20-
}
21-
},
14+
{cors:{origin:"*",
2215
methods: ["GET", "POST", "DELETE"],
2316
allowedHeaders: ["Content-Type"],
2417
credentials: true}}
2518
);
2619

27-
app.use((req, res, next) => {
28-
const referringDomain = req.get('Referer');
29-
const allowedDomain = 'https://score-keper.netlify.app';
30-
31-
if (referringDomain && referringDomain.startsWith(allowedDomain)) {
32-
next();
33-
} else {
34-
res.status(403).send('Unauthorized');
35-
}
36-
});
37-
3820
app.use(cors());
3921
app.use(express.json());
4022

0 commit comments

Comments
 (0)