How to use the @creditkarma/thrift-server-express.createThriftServer function in @creditkarma/thrift-server-express

To help you get started, we’ve selected a few @creditkarma/thrift-server-express examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github creditkarma / thrift-server / packages / thrift-integration / src / express-calculator-service.ts View on Github external
return {
                code: {
                    status: new Int64(0),
                },
                value: 'test',
            }
        },
        fetchUnion(): ICommonUnion {
            return { option1: 'test' }
        },
        broken(): void {
            throw new Error(`Yeah, this didn't work`)
        },
    }

    const app: express.Application = createThriftServer({
        path: EXPRESS_CALC_SERVER_CONFIG.path,
        thriftOptions: {
            serviceName: 'calculator-service',
            handler: new Calculator.Processor(serviceHandlers),
        },
    })

    app.get('/control', (req: express.Request, res: express.Response) => {
        res.send('PASS')
    })

    return app
}

@creditkarma/thrift-server-express

Express server middleware for the Apache Thrift protocol

Apache-2.0
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis