Skip to content

Commit 6cee721

Browse files
committed
thomasgauvin: add overview kv get started button
1 parent b568421 commit 6cee721

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

src/content/docs/kv/index.mdx

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,30 @@ export default {
4545
// write a key-value pair
4646
await env.KV_BINDING.put('KEY', 'VALUE');
4747

48-
// read a key-value pair
49-
const value = await env.KV_BINDING.get('KEY');
50-
51-
// list all key-value pairs
52-
const allKeys = await env.KV_BINDING.list();
53-
54-
// delete a key-value pair
55-
await env.KV_BINDING.delete('KEY');
56-
57-
// return a Workers response
58-
return new Response(
59-
JSON.stringify({
60-
value: value,
61-
allKeys: allKeys,
62-
}),
63-
);
64-
},
48+
// read a key-value pair
49+
const value = await env.KV_BINDING.get('KEY');
50+
51+
// list all key-value pairs
52+
const allKeys = await env.KV_BINDING.list();
53+
54+
// delete a key-value pair
55+
await env.KV_BINDING.delete('KEY');
56+
57+
// return a Workers response
58+
return new Response(
59+
JSON.stringify({
60+
value: value,
61+
allKeys: allKeys,
62+
}),
63+
);
64+
},
65+
6566
} satisfies ExportedHandler<{ KV_BINDING: KVNamespace }>;
6667

67-
```
68+
```
6869
</TabItem>
6970
<TabItem label="wrangler.jsonc">
71+
7072
```json
7173
{
7274
"$schema": "node_modules/wrangler/config-schema.json",
@@ -85,6 +87,7 @@ export default {
8587
]
8688
}
8789
```
90+
8891
</TabItem>
8992
</Tabs>
9093

@@ -144,7 +147,7 @@ See the full Workers KV [REST API and SDK reference](/api/resources/kv/subresour
144147
</TabItem>
145148
</Tabs>
146149

147-
Learn more about Workers KV [key concepts](/kv/concepts/how-kv-works/), or [get started](/kv/get-started/) with a [Cloudflare Workers](/workers/) project.
150+
<LinkButton href="/kv/get-started/">Get started</LinkButton>
148151

149152
---
150153

0 commit comments

Comments
 (0)