{key: value} structure is called in JS.async function fetchProductsAsJSON() {
const response = await fetch('https://mydomain.com/api/hello');
// waits until the request completes...
console.log(response);
}
fetchProductsAsJSON();const json = await response.json()mdn response json or mdn fetch will both have it
init on here https://developer.mozilla.org/en-US/docs/Web/API/fetch
context.env.VARIABLE_NAMEplatform is always undefined in the endpoints. How can I fix this so I can access platform.env while testing locally with wrangler2?platform is always undefined: https://github.com/sveltejs/kit/tree/master/packages/adapter-cloudflare#environment-variablesnext() instead context.next() in your exampleconst file = await next() to get the response and then run an HTMLRewriter on top{key: value}async function fetchProductsAsJSON() {
const response = await fetch('https://mydomain.com/api/hello');
// waits until the request completes...
console.log(response);
}
fetchProductsAsJSON();const json = await response.json()mdn response jsonmdn fetchinitcontext.env.VARIABLE_NAMEwrangler pages dev --port 8788 --proxy 3000 --binding $(cat .env) -- svelte-kit devplatformplatformplatform.envnext()context.next()const file = await next()HTMLRewriterfetch(url, {
headers: {
'foo': 'bar'
}
}