astro/packages/integrations/cloudflare/test/fixtures/cf/src/pages/index.astro
beynar 6d8aa4b61f
[Cloudflare integration] Expose cf metadata and Cloudflare caches API (#7386)
* Add cf and cache properties to runtime

* add changeset

* reorder import

* fix types and add tests

* fix package name

* test
2023-06-13 16:34:44 -04:00

14 lines
298 B
Text

---
import { getRuntime } from '@astrojs/cloudflare/runtime';
const runtime = getRuntime(Astro.request);
---
<html>
<head>
<title>Testing</title>
</head>
<body>
<h1>Testing</h1>
<div id="cf">{JSON.stringify(runtime.cf)}</div>
<div id="hasCache">{!!runtime.caches}</div>
</body>
</html>