How to use the @creditkarma/thrift-server-core.normalizePath function in @creditkarma/thrift-server-core

To help you get started, we’ve selected a few @creditkarma/thrift-server-core 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-client / src / main / connections / HttpConnection.ts View on Github external
path = '/thrift',
        https = false,
        transport = 'buffered',
        protocol = 'binary',
        requestOptions = {},
        serviceName,
        withEndpointPerMethod = false,
        headerBlacklist = [],
    }: IHttpConnectionOptions) {
        super(Core.getTransport(transport), Core.getProtocol(protocol))
        this.requestOptions = Object.freeze(
            filterHeaders(requestOptions, headerBlacklist),
        )
        this.port = port
        this.hostName = hostName
        this.path = Core.normalizePath(path || DEFAULT_PATH)
        this.protocol = https === true ? 'https' : 'http'
        this.serviceName = serviceName
        this.basePath = `${this.protocol}://${this.hostName}:${this.port}`
        this.withEndpointPerMethod = withEndpointPerMethod
        this.url = `${this.basePath}${this.path}`
        this.filters = []
    }
github creditkarma / thrift-server / packages / thrift-server-hapi / src / main / ThriftServerHapi.ts View on Github external
export function ThriftServerHapi<
    TProcessor extends Core.IThriftProcessor
>(pluginOptions: IHapiPluginOptions): ThriftHapiPlugin {
    const thriftOptions: IHapiServerOptions =
        pluginOptions.thriftOptions
    const logger: Core.LogFunction = thriftOptions.logger || defaultLogger
    const thriftPath: string = Core.normalizePath(
        pluginOptions.path || DEFAULT_PATH,
    )
    const serviceName: string = pluginOptions.thriftOptions.serviceName

    const Transport: Core.ITransportConstructor = Core.getTransport(
        thriftOptions.transport,
    )
    const Protocol: Core.IProtocolConstructor = Core.getProtocol(
        thriftOptions.protocol,
    )
    const processor: Core.IThriftProcessor = thriftOptions.handler
    const rawServiceName: string = processor._serviceName

    return {
        name: require('../../package.json').name,
        version: require('../../package.json').version,