mirror of
https://github.com/YuzuZensai/Kiroku.git
synced 2026-01-06 04:33:18 +00:00
Support CORS
This commit is contained in:
@@ -25,7 +25,10 @@ interface ReturnData {
|
||||
let latestReturnData: ReturnData = {};
|
||||
|
||||
function sendJsonResponse(data: any) {
|
||||
return new Response(JSON.stringify(data));
|
||||
let res = new Response(JSON.stringify(data));
|
||||
res.headers.set('Access-Control-Allow-Origin', '*');
|
||||
res.headers.set('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
|
||||
return res;
|
||||
}
|
||||
|
||||
async function main() {
|
||||
|
||||
Reference in New Issue
Block a user