import { ProtoCat } from 'protocat'
import { CatService } from '../dist/cat_grpc_pb' // Generated service definition
app = new ProtoCat()
app.addService(CatService, {
getCat: async call => {
const cat = await getCatByName(call.request?.getName() ?? '')
call.response.setName(cat.name)
.setHealth(cat.health)
.setLevel(cat.level)
.setClass(cat.profession ?? 'warrior')
}
}
app.start('0.0.0.0:3000')
Learn more about ProtoCat in docs.
Project is sponsored by Ackee.
- Mali - Minimalistic Node.js gRPC microservice framework
- BloomRPC - GUI Client for GRPC Services
- ghz - Simple gRPC benchmarking and load testing tool
- grpc-health-probe - A command-line tool to perform health-checks for gRPC applications in Kubernetes etc.
This project is licensed under MIT.