grpc-web-middleware
simple nodejs middleware acting as a grpc-web gateway
Installation
Intall grpc-web-middleware with npm registry
$ npm install grpc-web-middleware
Configuration
const grpcWebMiddleware =
grpcWebMiddleware(grpcServerUrl,[prefix])
grpcServerUrl
- The grpc server base urlprefix
- add a path prefix to handle grpc web request
Returns async function (req, res, next)
Examples
Express
const express = const expressApp = const expressCors = const grpcWebMiddleware = expressAppexpressApp
Koa
const Koa = const koaApp = const koaCors = const grpcWebMiddleware = koaAppkoaApp