Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brunonunes/moleculer-grpc-api
gRPC server for Moleculer API Gateway
https://github.com/brunonunes/moleculer-grpc-api
Last synced: 2 months ago
JSON representation
gRPC server for Moleculer API Gateway
- Host: GitHub
- URL: https://github.com/brunonunes/moleculer-grpc-api
- Owner: brunonunes
- License: mit
- Created: 2020-05-13T02:03:55.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-25T18:23:45.000Z (about 1 year ago)
- Last Synced: 2024-10-13T05:36:33.107Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 35.2 KB
- Stars: 20
- Watchers: 1
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-moleculer - moleculer-grpc-api - [gRPC](https://grpc.io/) server for Moleculer. (Services / Gateway)
README
# moleculer-grpc-api
[Moleculer gRPC API](https://grpc.io/) mixin for [Moleculer API Gateway](https://github.com/moleculerjs/moleculer-web)
## Features
## Install
```
npm i moleculer-grpc-api moleculer-web
```## Usage
This example demonstrates how to setup a Moleculer API Gateway with gRPC mixin in order to handle incoming gRPC requests.```js
"use strict";const { GrpcService } = require("moleculer-grpc-api");
module.exports = {
name: "grpc",mixins: [
// gRPC Server
GrpcService({// Directory with you .proto files
directory: `${dirname}/../protos`,// gRPC port. Default: 50051
port: ``// List of actions available. ${protoPackage}.${protoService}/${serviceName}: ${moleculerService}.${moculerAction}
aliases: {
'helloworld.Greeter': {
'sayHello': 'greeter.sayHello'
}
},// Authentication action to populate ctx.user using header
authentication: {
action: "user.currentUser",
params: {
accessToken: "Authorization"
}
},
})
]
};```
Start your Moleculer project and send gRPC requests.
# Contribution
Please send pull requests improving the usage and fixing bugs, improving documentation and providing better examples, or providing some testing, because these things are important.# License
The project is available under the [MIT license](https://tldrlegal.com/license/mit-license).