export default {
async fetch(request) {
const url = 'https://view.monday.com/3776000595-36cfd13f4d0b049a330a3952bdae0ff9';
async function gatherResponse(response) {
const { headers } = response;
const contentType = headers.get('content-type') || '';
if (contentType.includes('application/json')) {
return JSON.stringify(await response.json());
} else if (contentType.includes('application/text')) {
return response.text();
} else if (contentType.includes('text/html')) {
return response.text();
} else {
return response.text();
}
}
const init = {
headers: {
'content-type': 'text/html;charset=UTF-8',
},
};
const response = await fetch(url, request);
const results = await gatherResponse(response);
return new Response(results, init);
},
};
export default {
async fetch(request) {
const url = 'https://view.monday.com/3776000595-36cfd13f4d0b049a330a3952bdae0ff9';
async function gatherResponse(response) {
const { headers } = response;
const contentType = headers.get('content-type') || '';
if (contentType.includes('application/json')) {
return JSON.stringify(await response.json());
} else if (contentType.includes('application/text')) {
return response.text();
} else if (contentType.includes('text/html')) {
return response.text();
} else {
return response.text();
}
}
const init = {
headers: {
'content-type': 'text/html;charset=UTF-8',
},
};
const response = await fetch(url, request);
const results = await gatherResponse(response);
return new Response(results, init);
},
};