allow cors for api

This commit is contained in:
Михаил Капелько
2025-08-17 23:47:44 +03:00
parent 81f39d238f
commit 9755c47789

View File

@@ -73,7 +73,13 @@ function returnNoCORS(res) {
} }
function returnSuccess(res) { function returnSuccess(res) {
res.writeHead(200, { "Content-Type": "application/json;charset=UTF-8" }); res.writeHead(
200,
{
"Access-Control-Allow-Origin": "*",
"Content-Type": "application/json;charset=UTF-8",
}
);
let dat = { code: 4 }; let dat = { code: 4 };
res.end(JSON.stringify(dat)); res.end(JSON.stringify(dat));
} }