Skip to content

Commit

Permalink
add storage instance option
Browse files Browse the repository at this point in the history
  • Loading branch information
wernst committed Jun 26, 2024
1 parent b0cb05a commit 808c4fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function parseClientMessage(
}

export type ServerOptions = {
storage?: StoreKeys | (() => Storage);
storage?: StoreKeys | Storage | (() => Storage);
dbOptions?: DBConfig<any>;
watchMode?: boolean;
verboseLogs?: boolean;
Expand Down Expand Up @@ -96,7 +96,9 @@ export function createServer(options?: ServerOptions) {
const dbSource = !!options?.storage
? typeof options.storage === 'string'
? resolveStorageStringOption(options.storage)
: options.storage()
: typeof options.storage === 'function'
? options.storage()
: options.storage
: undefined;
if (options?.verboseLogs) logger.verbose = true;
const triplitServers = new Map<string, TriplitServer>();
Expand Down

0 comments on commit 808c4fc

Please sign in to comment.