allow cors for api
This commit is contained in:
@@ -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));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user