Example gRPC server implemented in Python
Deploy the app
export DOMAIN=my.cf.app.domain
cf push -f app-manifest.yml --var domain=$DOMAIN
cf push --no-route python-grpc-test --buildpack https://github.com/cloudfoundry/python-buildpack
# my.cf.app.domain is used as an example for demonstration purpose
cf map-route python-grpc-test my.cf.app.domain --hostname python-grpc-test --app-protocol http2
grpcurl
needs to be installed separately.
grpcurl -proto example.proto python-grpc-test.my.cf.app.domain:443 Example.Run
pipenv install -r requirements.txt
PORT=8080 pipenv run python3 main.py
grpcurl -proto example.proto -plaintext localhost:8080 Example.Run
python -m pip install grpcio-tools
python -m grpc_tools.protoc -I . --python_out . --grpc_python_out . example.proto