From f7a896202e4a6acd2c248904cdc32dae2773550b Mon Sep 17 00:00:00 2001 From: "S. Amir Mohammad Najafi" Date: Fri, 25 Nov 2022 12:30:39 +0330 Subject: [PATCH] fix(demo/storage-client): set default token --- demo/storage-client/index.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/demo/storage-client/index.ts b/demo/storage-client/index.ts index 18aae4de0..6f91ac6dc 100644 --- a/demo/storage-client/index.ts +++ b/demo/storage-client/index.ts @@ -9,10 +9,7 @@ interface User extends DocumentObject { token?: string; } -const token = process.env.TOKEN; -if (token == null) { - throw new Error('token_not_defined'); -} +const token = process.env.TOKEN ?? 'YOUR_SECRET_TOKEN'; const db = new AlwatrStorageClient({ name: 'user-list', @@ -66,8 +63,8 @@ await db.set({ console.log('has \'alimd\': %o', await db.has('alimd')); console.log('keys: %o', await db.keys()); console.log('getAll: %o', await db.getAll()); -console.log('delete: %o', await db.delete('alimd')); -console.log('delete: %o', await db.delete('fmd')); +await db.delete('alimd'); +await db.delete('fmd'); try { await db.delete('abcd');