@injectivelabs/grpc-web-http-transport
v0.0.1
Published
InjectiveLabs HTTP Transport for use with @improbable/grpc-web
Downloads
3
Maintainers
Keywords
Readme
@injectivelabs/grpc-web-node-http-transport
Injective HTTP Transport for use with @injectivelabs/grpc-web
Usage
When making a gRPC request, specify this transport:
import { grpc } from '@injectivelabs/grpc-web';
import { InjectiveHttpTransport } from '@injectivelabs/grpc-web-http-transport';
grpc.invoke(MyService.DoQuery, {
host: "https://example.com",
transport: InjectiveHttpTransport(),
/* ... */
})
Alternatively specify the Default Transport when your server/application bootstraps:
import { grpc } from "@injectivelabs/grpc-web";
import { InjectiveHttpTransport } from "@injectivelabs/grpc-web-http-transport";
// Do this first, before you make any grpc requests!
grpc.setDefaultTransport(InjectiveHttpTransport());