wtf
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { Backend } from '../src/Backend'
|
||||
|
||||
const testServer = new Backend(20000, [{
|
||||
name: "HelloWorldRPCGroup",
|
||||
publicRPCs: () => [],
|
||||
localRPCs: () => [{
|
||||
type: 'Call',
|
||||
name: 'echo',
|
||||
call: async (s:string) => s,
|
||||
}]
|
||||
}])
|
||||
@@ -0,0 +1,7 @@
|
||||
import { Frontend } from '../src/Frontend'
|
||||
|
||||
const testClient = new Frontend(20000, 'localhost')
|
||||
testClient.connect().then(_ => {
|
||||
testClient.info().then(console.log)
|
||||
testClient["HelloWorldRPCGroup"].echo("x").then(console.log)
|
||||
})
|
||||
@@ -1,18 +0,0 @@
|
||||
import { Server } from '../src/Server'
|
||||
import {Client} from '../src/Client'
|
||||
|
||||
new Server(20000, [{
|
||||
name: "HelloWorldRPCGroup",
|
||||
publicRPCs: () => [],
|
||||
localRPCs: () => [{
|
||||
type: 'Call',
|
||||
name: 'echo',
|
||||
call: async (s:string) => s,
|
||||
}]
|
||||
}])
|
||||
|
||||
const caller = new Client(20000, 'localhost')
|
||||
caller.connect().then(_ => {
|
||||
caller.info().then(console.log)
|
||||
caller["HelloWorldRPCGroup"].echo("x").then(console.log)
|
||||
})
|
||||
Reference in New Issue
Block a user