const corsHeaders = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': '*',
'Access-Control-Max-Age': '86400', // optional
'Access-Control-Allow-Headers': 'Content-Type',
};
const CustomResponse = (body: any, status: number = 200) => {
return new Response(body, {
headers: {
...corsHeaders,
'Content-Type': 'application/json',
},
status,
});
};
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': '*',
'Access-Control-Max-Age': '86400', // optional
'Access-Control-Allow-Headers': 'Content-Type',
};
const CustomResponse = (body: any, status: number = 200) => {
return new Response(body, {
headers: {
...corsHeaders,
'Content-Type': 'application/json',
},
status,
});
};