Skip to content

Commit 6bf6709

Browse files
authored
update KV namespace (#15)
1 parent 1aca95e commit 6bf6709

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

kv/kv-get-started/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
export interface Env {
2-
USER_NOTIFICATION: KVNamespace;
2+
USERS_NOTIFICATION_CONFIG: KVNamespace;
33
}
44

55
export default {
66
async fetch(request, env, ctx): Promise<Response> {
77
try {
8-
await env.USER_NOTIFICATION.put("user_2", "disabled");
9-
const value = await env.USER_NOTIFICATION.get("user_2");
8+
await env.USERS_NOTIFICATION_CONFIG.put("user_2", "disabled");
9+
const value = await env.USERS_NOTIFICATION_CONFIG.get("user_2");
1010
if (value === null) {
1111
return new Response("Value not found", { status: 404 });
1212
}

kv/kv-get-started/wrangler.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"kv_namespaces": [
1414
{
15-
"binding": "USER_NOTIFICATION",
15+
"binding": "USERS_NOTIFICATION_CONFIG",
1616
"id": "<ADD YOUR KV NAMESPACEID HERE>"
1717
}
1818
]

0 commit comments

Comments
 (0)