{"id":48010,"library":"grpc-dg","title":"grpc-dynamic-gateway","description":"A Node.js dynamic gRPC-to-REST/JSON proxy middleware that reads .proto files at runtime without code generation. Version 0.4.2 is the latest; release cadence is irregular. Unlike grpc-gateway (which requires generating a Go server), this package works as Express/Connect middleware, dynamically serving REST endpoints from proto definitions. Supports SSL, CLI usage, and Docker deployment.","status":"active","version":"0.4.2","language":"javascript","source_language":"en","source_url":"https://github.com/cjs77/grpc-dynamic-gateway","tags":["javascript","grpc","express","middleware","swagger","rest","json","protobuf"],"install":[{"cmd":"npm install grpc-dg","lang":"bash","label":"npm"},{"cmd":"yarn add grpc-dg","lang":"bash","label":"yarn"},{"cmd":"pnpm add grpc-dg","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used as middleware; requires an Express app","package":"express","optional":false},{"reason":"Needed for JSON/URL-encoded body parsing in Express","package":"body-parser","optional":true}],"imports":[{"note":"Package uses CommonJS; ESM import is not supported.","wrong":"import grpcGateway from 'grpc-dynamic-gateway'","symbol":"default","correct":"const grpcGateway = require('grpc-dynamic-gateway')"},{"note":"No named exports; only default export.","wrong":"","symbol":"grpcGateway","correct":"const grpcGateway = require('grpc-dynamic-gateway')"}],"quickstart":{"code":"const grpcGateway = require('grpc-dynamic-gateway');\nconst express = require('express');\nconst bodyParser = require('body-parser');\n\nconst app = express();\napp.use(bodyParser.json());\napp.use(bodyParser.urlencoded({ extended: false }));\n\nconst grpcHost = process.env.GRPC_HOST || '0.0.0.0:5051';\napp.use('/', grpcGateway(['api.proto'], grpcHost));\n\nconst port = process.env.PORT || 8080;\napp.listen(port, () => {\n  console.log(`Listening on http://0.0.0.0:${port}`);\n});","lang":"javascript","description":"Creates an Express server that serves REST endpoints dynamically from a gRPC proto definition."},"warnings":[{"fix":"Ensure .proto files are included in deployment or mounted via volume.","message":"Proto files must be accessible at runtime; no pre-compilation step.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use require() instead of import.","message":"Package uses CommonJS; cannot be imported with ES module import syntax.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Upgrade Node.js to version 6 or later.","message":"Drops support for Node < 6 in version 0.4.0.","severity":"breaking","affected_versions":">=0.4.0"}],"env_vars":null,"search_vec":"'/json':12 '0.4.2':25 'cadenc':30 'cli':58 'code':22 'definit':55 'deploy':62 'docker':61 'dynam':3,7,49 'endpoint':52 'express':65 'express/connect':47 'file':18 'gateway':4,36 'generat':23,39 'go':41 'grpc':2,9,35,64 'grpc-dynamic-gateway':1 'grpc-gateway':34 'grpc-to-rest':8 'irregular':32 'javascript':63 'json':69 'latest':28 'middlewar':14,48,66 'node.js':6 'packag':44 'proto':17,54 'protobuf':70 'proxi':13 'read':16 'releas':29 'requir':38 'rest':11,51,68 'runtim':20 'serv':50 'server':42 'ssl':57 'support':56 'swagger':67 'unlik':33 'usag':59 'version':24 'without':21 'work':45","created_at":"2026-06-07T16:54:28.655956+00:00","updated_at":"2026-06-07T16:54:28.655956+00:00","problems":[{"fix":"npm install grpc","cause":"Missing gRPC dependency.","error":"Error: Cannot find module 'grpc'"},{"fix":"Provide absolute path or correct relative path to .proto file.","cause":"Proto file path is incorrect or missing.","error":"Error: ENOENT: no such file or directory, open '.../api.proto'"},{"fix":"Use require('grpc-dynamic-gateway') instead of import.","cause":"Incorrect import method (ESM import).","error":"TypeError: grpcGateway is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/konsumer/grpc-dynamic-gateway#readme","github":"https://github.com/cjs77/grpc-dynamic-gateway","docs":null,"changelog":null,"pypi":null,"npm":"grpc-dg","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}