grpc-web-node-http-transportdeprecated

Node HTTP Transport for use with grpc-web-client

Usage no npm install needed!

<script type="module">
  import grpcWebNodeHttpTransport from 'https://cdn.skypack.dev/grpc-web-node-http-transport';
</script>

README

grpc-web-node-http-transport

Node HTTP Transport for use with grpc-web-client

Usage

When making a gRPC request, specify this transport:

import { grpc } from 'grpc-web-client';
import { NodeHttpTransport } from '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 "grpc-web-client";
import { NodeHttpTransport } from "grpc-web-node-http-transport";

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