diff --git a/rpc.ts b/rpc.ts index 1bb325f..bb7cdb3 100644 --- a/rpc.ts +++ b/rpc.ts @@ -25,3 +25,6 @@ export const rpcs = { return toUser(user) }, } + +export type LyricsRPCs = typeof rpcs +export const rpcNames = Object.keys(rpcs) diff --git a/rpcClient.ts b/rpcClient.ts new file mode 100644 index 0000000..f18e02b --- /dev/null +++ b/rpcClient.ts @@ -0,0 +1,7 @@ +import { genCalls } from 'saurpc' +import { LyricsRPCs, rpcNames } from '@lyrics/rpc.ts' + +export const client = genCalls( + rpcNames, + 'http://localhost:8000/api/rpc', +)