You could do this, but why not just run the API from within Astro?
You could do this, but why not just run the API from within Astro?
@astrojs/cloudflare adapter yet..environments for pages same as for workers? meaning this: https://developers.cloudflare.com/workers/wrangler/environments/fetch(/api) in Astro this will probably not work because the request will not go through the edge network (completely), right ? - I will have to use the full url... or am I mistakennext-on-pages--d1 arguments --kv arguments manually
exlude: ["/api/*"] I get the following error from pages:(log) TypeError: Fetch API cannot load: /api/v1/pingdashboard.ruxiom.dev
/api/[...request].js route (which is an api route) in my pages folder.route = { pattern = "dashboard.ruxiom.dev/api/*", zone_name = "ruxiom.dev" }0:23:57.383 Deploying your site to Cloudflare's global network...
20:24:00.014 Uploading... (0/26)
20:24:00.742 Uploading... (9/26)
20:24:00.898 Uploading... (17/26)
20:24:01.763 Uploading... (26/26)
20:24:01.763 ✨ Success! Uploaded 26 files (2.31 sec)
20:24:01.763
20:24:02.295 ✨ Upload complete!
20:24:04.409 Success: Assets published!
20:24:05.495 Success: Your site was deployed!export async function GET({ params }) {
const backendRequest = await fetch(
"https://dashboard.ruxiom.dev/api/" + params.request,
{
headers: {
"CF-Access-Client-Id": "something.access",
"CF-Access-Client-Secret":
"something different",
},
}
);
return backendRequest.clone();
}