Action Protocol, abstract layer to help create your microservice.
Julio Contreras
Posted on November 2, 2021
Hello world! I've been a programmer for over ten years in different technologies.
This year I started making my own microservices and found many interesting things like DDD architecture, gRPC protocols and metrics systems.
In the middle of development I came across a question. How use HTTP or gRPC without change my application?
It was when I had the idea to create an abstraction layer, where I pass the action, data and authorization token.
This also allows to control the time and quantity of general requests or by type of action.
Example data:
{
"action": "createCar",
"data": {
"brand": "Ferrary",
"color": "red"
},
"token": "mytokensecret"
}
Repository:
https://www.npmjs.com/package/action-grpc
Example project using action-grpc:
- src/infrastructure/http/http.ts
- src/infrastructure/grpc/grpc.ts
https://github.com/julioacontreras/authenticator-storage
Thank´s and good vibes!
Bye
Posted on November 2, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.