{"id":13740340,"url":"https://github.com/ericbets/danby","last_synced_at":"2025-05-08T20:30:57.583Z","repository":{"id":29448129,"uuid":"121719922","full_name":"ericbets/danby","owner":"ericbets","description":"A webserver that's also a grpc proxy for browsers","archived":false,"fork":false,"pushed_at":"2022-12-10T16:14:41.000Z","size":248,"stargazers_count":30,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-04T04:06:28.390Z","etag":null,"topics":["grpc","grpc-framework","grpc-gateway","grpc-java","grpc-web","microservice","nodejs","proxy"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericbets.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-16T06:02:46.000Z","updated_at":"2021-10-28T06:34:34.000Z","dependencies_parsed_at":"2023-01-14T14:57:14.560Z","dependency_job_id":null,"html_url":"https://github.com/ericbets/danby","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericbets%2Fdanby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericbets%2Fdanby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericbets%2Fdanby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericbets%2Fdanby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericbets","download_url":"https://codeload.github.com/ericbets/danby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224765443,"owners_count":17366120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grpc","grpc-framework","grpc-gateway","grpc-java","grpc-web","microservice","nodejs","proxy"],"created_at":"2024-08-03T04:00:46.574Z","updated_at":"2024-11-15T10:30:34.449Z","avatar_url":"https://github.com/ericbets.png","language":"JavaScript","readme":"Danby\n===================\n\nLightweight approach to grpc microservices in the browser. No client side lib required.\n\n\nFeatures\n--------\n* Bare minimum configuration required, uses helmet.js to set HTTP headers to sane defaults.\n* Proxy multiple grpc microservices to this webserver, as long as they have unique grpc service names.\n* Proxy multiple routes to other http servers. Eg. \"/\" to localhost:3000 might map to a react app.\n\n\nUsage\n--------\nTo install using globally, try --unsafe-perm or --allow-root [why](https://github.com/nodejs/node-gyp/issues/454)\n\n\n```shell\n$ npm install danby\n\n$ danby\nOptions:\n  --help     Show help                                                 [boolean]\n  --version  Show version number                                       [boolean]\n  --port     http port                                                [required]\n  --cfg      path to toml config file\n  --cert     path to ssl/tls cert file\n  --key      path to ssl/tls private key \n  --webroot  path to webroot, defaults to $PWD \n  --debug    debug output to console \n```\n\n\nExample\n-------\nLet's say you want to serve some static files with access to the grpc Greeter interface.\nAdd this into the head tag of your chosen html file:\n\n```html\n\u003cscript src=\"/grpc-api\"\u003e\u003c/script\u003e\n```\n\nNow modify config.toml.sample to suit your local environment. Then from the console, cd into the folder you want to serve:\n\n```shell\n$ cd website\n$ danby --port 3000 --cfg config.toml\n```\n\nNow in the browser: \n\n```js\n//Manage call creds by setting the metadata eg. Greeter.metadata[\"token\"] = ...\nGreeter.SayHello({name: 'user'}).then(function(resp) { console.log(resp); });\n```\n\nIn your config file, try to use absolute paths for your .proto files otherwise the paths will be relative to the folder you started the webserver in, not the config file. Or start the webserver from your config folder, and use --webroot.\n\n\nTodo\n------\n* Streaming support\n* Let user choose between Promises or Callbacks\n\n","funding_links":[],"categories":["Tools","proxy"],"sub_categories":["Other"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericbets%2Fdanby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericbets%2Fdanby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericbets%2Fdanby/lists"}