1.0.6 • Published 2 years ago

alvintanudjaja-grpc-lib v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

gRPC Library

This is a library for gRPC services. It contains base gRPC service and client that can be inherited. It also has sample middlewares and utilities.

Feel free to fork this project as well as add more middlewares and utilities specific to your respective projects and requirements.

Overview

Base service wraps gRPC service method and allows the addition of common pre-logic, post-logic and error hanlding middleware for all the calls.

Base client wraps gRPC method call and standardises the call to return Promise instead of callback. The Promise will resolve if successful and reject as well as throw an error if the call status is not successful.

Config util helps to load .env file by just importing config in your project. JWT util helps to generate and verify JWT token.

Middleware

Below are the details of the sample middlewares:

MiddlewareRemarks
AuditAudit user calls and log it for record purposes so that administrators can audit users activity
AuthenticateAuthenticate the user based on JWT token sent through authorization metadata
AuthorizeAuthorize the user based on the service called and permissions stored in JWT token
Error HandlerSimple error handler middleware to log the details to console
InitialiseInitialise requests with necessary parameters, e.g. startTime for below monitor middleware
MonitorMonitor the performance of user calls

Build

To install the dependencies, run:

npm i

To build the codes to dist, run:

npm run build

To publish the codes to be used by services, create npm account and login to your account in terminal by running:

npm login

Once you are logged in, you can publish by running:

npm publish

Related Projects

grpc_proto

grpc_service

grpc_client

Contributors

Thanks goes to these people, in no particular order, without whom it would not be possible to complete this project.

Yang Guang

Calvin Sim

Viet Son

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.1.0

2 years ago

0.0.28

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago