Skip to content

Commit

Permalink
Merge pull request #432 from AliMD/fix/demo
Browse files Browse the repository at this point in the history
fix(demo/storage-client): set default token
  • Loading branch information
alimd authored Nov 25, 2022
2 parents f672f05 + eec20b7 commit b1fef18
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions demo/storage-client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<User>({
name: 'user-list',
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit b1fef18

Please sign in to comment.