From 783f72cb91b436e8ee6d7349da4cf72dc3219aa1 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 14 Sep 2025 12:47:21 +0000 Subject: feat: Add scripts to migrate all content from one server to the other --- apps/cli/src/lib/trpc.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'apps/cli/src/lib/trpc.ts') diff --git a/apps/cli/src/lib/trpc.ts b/apps/cli/src/lib/trpc.ts index e6c5555d..deb5c392 100644 --- a/apps/cli/src/lib/trpc.ts +++ b/apps/cli/src/lib/trpc.ts @@ -21,3 +21,20 @@ export function getAPIClient() { ], }); } + +export function getAPIClientFor(opts: { serverAddr: string; apiKey: string }) { + return createTRPCClient({ + links: [ + httpBatchLink({ + url: `${opts.serverAddr}/api/trpc`, + maxURLLength: 14000, + transformer: superjson, + headers() { + return { + authorization: `Bearer ${opts.apiKey}`, + }; + }, + }), + ], + }); +} -- cgit v1.2.3-70-g09d2