From 0b0314f636ee929f5b6b5b82ef82f5dda6e1116e Mon Sep 17 00:00:00 2001 From: CNCF-bot Date: Thu, 2 Mar 2023 20:38:02 +0000 Subject: [PATCH] support cors --- src/api/items.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api/items.js b/src/api/items.js index b09e6242..5c7a0cbc 100644 --- a/src/api/items.js +++ b/src/api/items.js @@ -26,6 +26,10 @@ const processRequest = module.exports.processRequest = query => { // Netlify function module.exports.handler = async function(event) { const body = processRequest(event.queryStringParameters) - const headers = { 'Content-Type': 'application/json' } + const headers = { + 'Content-Type': 'application/json', + 'Access-Control-Allow-Origin': '*', + 'Access-Control-Allow-Credentials': true + } return { statusCode: 200, body: JSON.stringify(body), headers } }