// import { GameService } from '../codegen/common/'; import { PlayerService } from '../codegen/common/'; import { ClientServiceHandler } from '../handler/client-service-handler'; import * as express from 'express'; import { createThriftServer } from '@creditkarma/thrift-server-express'; const handler: ClientServiceHandler = new ClientServiceHandler(); export class ThriftServer { private app: express.Application; constructor(port: number) { this.app = createThriftServer({ path: '/thrift', thriftOptions: { serviceName: 'calculator-service', handler: new PlayerService.Processor(handler), }, }); this.app.listen(port, () => { console.log(`Thrift Express server listening on port: ${port}`); }); } }