This commit is contained in:
Daniel Hübleitner
2019-09-18 07:34:51 +02:00
parent a744e9df9b
commit 7ff0d1e67e
12 changed files with 52 additions and 287 deletions
+11
View File
@@ -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,
}]
}])
+7
View File
@@ -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)
})
-18
View File
@@ -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)
})