RPC
This commit is contained in:
parent
7825dda25e
commit
7b35f4d490
2 changed files with 10 additions and 0 deletions
3
rpc.ts
3
rpc.ts
|
@ -25,3 +25,6 @@ export const rpcs = {
|
||||||
return toUser(user)
|
return toUser(user)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type LyricsRPCs = typeof rpcs
|
||||||
|
export const rpcNames = Object.keys(rpcs)
|
||||||
|
|
7
rpcClient.ts
Normal file
7
rpcClient.ts
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
import { genCalls } from 'saurpc'
|
||||||
|
import { LyricsRPCs, rpcNames } from '@lyrics/rpc.ts'
|
||||||
|
|
||||||
|
export const client = genCalls<LyricsRPCs>(
|
||||||
|
rpcNames,
|
||||||
|
'http://localhost:8000/api/rpc',
|
||||||
|
)
|
Loading…
Add table
Reference in a new issue