Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/namnv2496/go-grpc-gateway
This is a demo of grpc gateway interceptor and tls
https://github.com/namnv2496/go-grpc-gateway
app-demo basic-programming golang grpc grpc-gateway
Last synced: 7 days ago
JSON representation
This is a demo of grpc gateway interceptor and tls
- Host: GitHub
- URL: https://github.com/namnv2496/go-grpc-gateway
- Owner: NamNV2496
- Created: 2024-06-26T13:56:26.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-06-27T06:28:03.000Z (7 months ago)
- Last Synced: 2025-01-02T19:45:39.502Z (7 days ago)
- Topics: app-demo, basic-programming, golang, grpc, grpc-gateway
- Language: Go
- Homepage:
- Size: 3.41 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Grpc gateway demo
![alt text](docs/flow.png)
# Technologies
1. grpc - "google.golang.org/grpc"
2. grpc-gateway - "github.com/grpc-ecosystem/grpc-gateway/v2"
3. grom - "gorm.io/gorm"
4. jwt - "github.com/golang-jwt/jwt"# 1. REST server
1. `cd http_gateway` and run `make rest`
2. in another terminal `cd http_gateway` and run `make server` to run server in grpc server
3. call API by postman in `docs` folder# 2. Grpc server
1. `cd http_gateway` and run `make server` to run server in grpc server
2. in another terminal `cd book_service` and run `make server` to run book server in grpc server
3. in another terminal `cd fe_service` and run `make client` to run grpc client# 3. TLS
1. `cd http_gateway` and run `make server-tls` to run server in grpc server
2. in another terminal `cd book_service` and run `make server` to run book server in grpc server
3. in another terminal `cd fe_service` and run `make client-tls` to run grpc client# 4. Nginx (It is not working now)
1. windows: [https://nginx.org/en/download.html](https://nginx.org/en/download.html)
2. macos: `brew install nginx`![alt text](docs/image-1.png)
![alt text](docs/image-2.png)```bash
nginx -t
# Output should be:
# nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
# nginx: configuration file /etc/nginx/nginx.conf test is successfulnetstat -an | find "8080"
# Output should indicate that NGINX is listening on port 8080, for example:
# TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING
```