Files
Jonny ReevesandGitHub c6a76a1c40 Migrate grpc-web-node-http-transport package so it's under the @improbable-eng org. on npm. (#299)
* Migrate grpc-web-node-http-transport package so it's under the @improbable-eng org. on npm.

To further disambiguate that this transport is specifically for use with the `@improbable-eng/grpc-web` package.

Note I've also fixed an issue with the dependencies; `@improbable-eng/grpc-web` should have been listed as a peer-dependency as it's intended to be used as a plugin (ie: the consumer is expected to have `@improbable-eng/grpc-web` somewhere in their dependency tree)

* Mess around with package lock files...
2019-01-13 15:57:28 +00:00

814 B

@improbable-eng/grpc-web-node-http-transport

Node HTTP Transport for use with @improbable-eng/grpc-web

Usage

When making a gRPC request, specify this transport:

import { grpc } from '@improbable-eng/grpc-web';
import { NodeHttpTransport } from '@improbable-eng/grpc-web-node-http-transport';

grpc.invoke(MyService.DoQuery, {
  host: "https://example.com",
  transport: NodeHttpTransport(),
  /* ... */
})

Alternatively specify the Default Transport when your server/application bootstraps:

import { grpc } from "@improbable-eng/grpc-web";
import { NodeHttpTransport } from "@improbable-eng/grpc-web-node-http-transport";

// Do this first, before you make any grpc requests!
grpc.setDefaultTransport(NodeHttpTransport());