btw, is this code ok? `// Reacts to POST /api/hello export async function onRequest(request) { //
btw, is this code ok?
// Reacts to POST /api/hello
export async function onRequest(request) {
// ...
const body = { "products" : [
{ "Name": "Cheese", "Location": "Refrigerated foods"},
{ "Name": "Crisps", "Location": "the Snack isle"},
{ "Name": "Pizza", "Location": "Refrigerated foods"},
]}
const headers = {
'Access-Control-Allow-Origin': '*',
'Content-type': 'application/json',
};
return new Response(body, { headers });
};
