Skip to content

Commit deb0bbe

Browse files
committed
Add readme
1 parent 4cba6d9 commit deb0bbe

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

examples/connectrpc_grpc_servers/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@
33
This example demonstrates the pattern of starting both a gRPC server and a ConnectRPC server in the same component on
44
different ports.
55

6+
The logic behind is that gRPC server is used for internal communication, while ConnectRPC server is proxied by a reverse
7+
proxy to handle external http requests coming from the frontend.
8+
69
Example shows that the same service is run by both servers, and the gRPC server is used to handle
710
gRPC requests, while the ConnectRPC server is used to handle ConnectRPC requests.
811

912
Dependencies are wired using [Cedi](https://github.com/igor-vovk/cedi) library.
1013

1114
Testing the ConnectRPC server:
15+
1216
1. Start the server by running:
17+
1318
```bash
1419
sbt example_connectrpc_grpc_servers/run
1520
```
21+
1622
2. Use `curl` to send http requests to the ConnectRPC server:
23+
1724
```bash
1825
curl -X POST http://localhost:8080/examples.v1.ElizaService/Say -d '{"sentence": "Hello Connectrpc"}' -H 'Content-Type: application/json'
1926
```

0 commit comments

Comments
 (0)