grpc-dynamic-gateway
Advanced tools
Comparing version 0.0.4 to 0.0.5
10
index.js
@@ -1,2 +0,2 @@ | ||
const grpc = require('grpc') | ||
const requiredGrpc = require('grpc') | ||
const express = require('express') | ||
@@ -15,3 +15,4 @@ | ||
*/ | ||
const middleware = (protoFiles, grpcLocation, credentials, debug, include) => { | ||
const middleware = (protoFiles, grpcLocation, credentials, debug, include, grpc) => { | ||
grpc = grpc || requiredGrpc | ||
credentials = credentials || grpc.credentials.createInsecure() | ||
@@ -38,3 +39,3 @@ const clients = {} | ||
const params = convertParams(req, child.options[`(google.api.http).${httpMethod}`]) | ||
const meta = convertHeaders(req.headers) | ||
const meta = convertHeaders(req.headers, grpc) | ||
if (debug) { | ||
@@ -123,3 +124,4 @@ console.log(`${pkg}.${svc}.${child.name}(${JSON.stringify(params)})`) | ||
*/ | ||
const convertHeaders = (headers) => { | ||
const convertHeaders = (headers, grpc) => { | ||
grpc = grpc || requiredGrpc | ||
headers = headers || {} | ||
@@ -126,0 +128,0 @@ const metadata = new grpc.Metadata() |
{ | ||
"name": "grpc-dynamic-gateway", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Like grpc-gateway, but written in node and dynamic.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20418
312