How to use the @creditkarma/thrift-server-hapi.ThriftServerHapi function in @creditkarma/thrift-server-hapi

To help you get started, we’ve selected a few @creditkarma/thrift-server-hapi 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 kevinbgreene / thrift-tutorial / src / identity / server.ts View on Github external
} else {
                    throw new UserServiceException({
                        message: `Unable to find user for id[${id}]`,
                    })
                }
            },
        })

    /**
     * Register the thrift plugin.
     *
     * This will add a Thrift route handler to the '/thrift' path.
     * This behaves like any other HTTP route handler, so you can mix and match
     * thrift / REST endpoints on the same server instance.
     */
    server.register(ThriftServerHapi({
        path: '/thrift',
        thriftOptions: {
            serviceName: '',
            handler: serviceProcessor,
        },
    }), (err: any) => {
        if (err) {
            throw err
        }
    })

    /**
     * Finally, we're ready to start the server.
     */
    server.start((err: any) => {
        if (err) {

@creditkarma/thrift-server-hapi

A Hapi server plugin for the Apache Thrift protocol

Apache-2.0
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis