James
05/19/2023, 12:14 AMUp
05/19/2023, 12:29 AMIsaac McFadyen | YYZ01
05/19/2023, 12:34 AMIsaac McFadyen | YYZ01
05/19/2023, 12:35 AMdave
05/19/2023, 1:59 AMdave
05/19/2023, 2:00 AMdave
05/19/2023, 2:01 AMjjxtra
05/19/2023, 2:30 AMkazu0617
05/19/2023, 6:49 AMCloudflare Workers Admin
as new account, but it can check audit log also.style
05/19/2023, 8:07 AMHardAtWork
05/19/2023, 8:09 AMsiri
05/19/2023, 8:28 AMsdan
05/19/2023, 8:29 AMDani Foldi
05/19/2023, 8:30 AMsdan
05/19/2023, 8:30 AMsdan
05/19/2023, 8:32 AMhttps://cdn.discordapp.com/attachments/779390076219686943/1109035765528268850/Screenshot_2023-05-19_at_1.31.40_AM.pngâ–¾
Dani Foldi
05/19/2023, 8:32 AMDani Foldi
05/19/2023, 8:33 AMstyle
05/19/2023, 8:34 AMLinka
05/19/2023, 10:09 AMhttps://cdn.discordapp.com/attachments/779390076219686943/1109060234804211802/image.pngâ–¾
Neiki
05/19/2023, 10:11 AMD3VL_Jack
05/19/2023, 10:26 AMUnsmart | Tech debt
05/19/2023, 12:58 PMBenParr
05/19/2023, 12:59 PMLicoricevntrs
05/19/2023, 1:24 PM${apiKey}
) {
return new Response('Error accessing this page', { status: 401 });
} else (pathname.startsWith("/id/")) {
const id = pathname.substring("/id/".length);
const { results } = await env.DB.prepare("SELECT * FROM products WHERE id= ?").bind(id).all();
return new Response(JSON.stringify(results), {
headers: {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, OPTIONS",
"Access-Control-Allow-Headers": "authorization, Content-Type",
"Access-Control-Allow-Credentials": "true"
}
});
}
...`
And here's my call:
`useEffect(() => {
var myHeaders = new Headers();
myHeaders.append("authorization", "mykey");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch(myendpoint.com/id/${id}
, requestOptions)
.then(response => response.json())
.then(data => {
if (data.length > 0) {
setArticle(data[0]);
}
})
.catch(error => setError(error));
}, [id]);`tanushree
05/19/2023, 1:50 PMD3VL_Jack
05/19/2023, 1:56 PMsathoro
05/19/2023, 2:24 PMLicoricevntrs
05/19/2023, 2:35 PM