feat(server): added keystore and made server cfg fetch from keystore to avoid db calls

This commit is contained in:
Akhil Mohan
2024-02-26 19:52:38 +05:30
parent 1cccbca0c5
commit 7d8b399102
9 changed files with 77 additions and 18 deletions
+19
View File
@@ -0,0 +1,19 @@
import { TKeyStoreFactory } from "@app/keystore/keystore";
export const mockKeyStore = (): TKeyStoreFactory => {
const store: Record<string, string | number | Buffer> = {};
return {
setItem: async (key, value) => {
store[key] = value;
return "OK";
},
getItem: async (key) => {
const value = store[key];
if (typeof value === "string") {
return value;
}
return null;
}
};
};