gRPC Support
Build high-performance microservices with native gRPC support. Support for unary, streaming, and bidirectional RPC calls with Protocol Buffers.
On this page
gRPC That Just Works
Build high-performance microservices with gRPC.
Unary, streaming, and bidirectional calls. Protocol Buffers included.
It's This Simple
Set up gRPC with one call
typescript
Why gRPC Matters
Without proper gRPC support, you're manually setting up servers, handling Protocol Buffers, and managing streaming. With MoroJS, you get all of that automatically.
Traditional gRPC setup requires complex configuration. We handle that automatically.
Without gRPC Support
- •Manual gRPC server setup
- •Complex Protocol Buffer handling
- •No built-in streaming support
- •Manual authentication setup
With MoroJS
- •One-call gRPC setup
- •Automatic Protocol Buffer handling
- •Built-in streaming support
- •Integrated authentication
Why It Makes Sense
Unary
Single request/response - REST-like operations
Server Streaming
Single request, stream responses - Data feeds
Client Streaming
Stream requests, single response - File uploads
Bidirectional
Stream both directions - Chat, real-time
How It Works
gRPC is a high-performance RPC framework that uses Protocol Buffers for serialization. MoroJS provides native gRPC support with automatic Protocol Buffer handling, streaming support, and integrated authentication. You define services in .proto files and implement handlers in your application.
Quick Start
Installation
typescript
Basic gRPC Server
typescript
Service Definition
Proto File Example
typescript
Server Implementation
Unary RPC
typescript
Server Streaming RPC
typescript
Bidirectional Streaming RPC
typescript
Client Usage
Creating a Client
typescript
Server Streaming Call
typescript
Authentication & Middleware
Token-Based Authentication
typescript
Role-Based Access
typescript
Features
Core Features
- Proto-based service definitions
- Unary, server streaming, client streaming, bidirectional
- Authentication and middleware support
- Built-in health check service
- Server reflection for debugging
- TLS/SSL support