We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0983d6 commit c2084c1Copy full SHA for c2084c1
src/server.js
@@ -33,6 +33,17 @@ const filter = (contests, options) => {
33
};
34
35
const server = http.createServer((req, res) => {
36
+ // Set CORS headers
37
+ res.setHeader('Access-Control-Allow-Origin', '*');
38
+ res.setHeader('Access-Control-Request-Method', '*');
39
+ res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET');
40
+ res.setHeader('Access-Control-Allow-Headers', '*');
41
+ if (req.method === 'OPTIONS') {
42
+ res.writeHead(200);
43
+ res.end();
44
+ return;
45
+ }
46
+
47
const { pathname, query } = url.parse(req.url, true);
48
49
if (pathname !== '/') {
0 commit comments