TSRPC_Test/test/test.ts
2022-04-29 15:25:10 +08:00

18 lines
410 B
TypeScript

import { HttpServer } from '../src/server/http/HttpServer';
import { serviceProto } from './proto/serviceProto';
let server = new HttpServer(serviceProto, {
jsonEnabled: true,
jsonRootPath: 'api'
});
server.implementApi('a/b/c/Test', call => {
call.logger.log('xxx', call.req);
call.succ({
reply: 'xxxxxxxxxxx',
aasdg: 'd',
b: 'asdg'
} as any)
});
server.start();