# grpc-flask-test **Repository Path**: xiaonq110/grpc-flask-test ## Basic Information - **Project Name**: grpc-flask-test - **Description**: flask+grpc+protobuf+nacos+nacos客户端注册、发现 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-12-14 - **Last Updated**: 2021-12-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### Compile command - 生成 protoc文件 ```bash # 指定文件夹生成 cd protos python3 -m grpc_tools.protoc -Iprotos --python_out=compiles --grpc_python_out=compiles protos/recommendations.proto ``` - 安装包 ```bash python3 -m pip install -r requirements.txt ``` - `启动grpc 服务端` ```bash cd grpc_server python3 app.py # server will start localhost:50051 ``` - `启动 grpc客户端` ```bash cd grpc_client python3 app.py # flask server will start ```localhost:5000``` ``` - http://127.0.0.1:5000/ 谷歌浏览器 ```json { "recommendations": [ { "id": 1, "title": "The Maltese Falcon" }, { "id": 3, "title": "The Hound of the Baskervilles" }, { "id": 2, "title": "Murder on the Orient Express" } ] } ```