mirror of
https://github.com/ApfelTeeSaft/R2-Explorer.git
synced 2026-08-26 19:33:39 +00:00
13 lines
359 B
TypeScript
13 lines
359 B
TypeScript
export function JsonResponse(json: any, status = 200, headers = {}) {
|
|
return new Response(JSON.stringify(json), {
|
|
headers: {
|
|
'content-type': 'application/json;charset=UTF-8',
|
|
'access-control-allow-origin': '*',
|
|
'access-control-allow-headers': '*',
|
|
'access-control-allow-methods': '*',
|
|
...headers,
|
|
},
|
|
status,
|
|
})
|
|
}
|