diff --git a/run/pubsub/main.py b/run/pubsub/main.py index 4051f73d018..e204943b395 100644 --- a/run/pubsub/main.py +++ b/run/pubsub/main.py @@ -13,16 +13,16 @@ # limitations under the License. # [START cloudrun_pubsub_server_setup] -# [START run_pubsub_server_setup] +# [START cloudrun_pubsub_server] import base64 -import os from flask import Flask, request app = Flask(__name__) -# [END run_pubsub_server_setup] + # [END cloudrun_pubsub_server_setup] +# [END cloudrun_pubsub_server] # [START cloudrun_pubsub_handler] @@ -53,11 +53,3 @@ def index(): # [END run_pubsub_handler] # [END cloudrun_pubsub_handler] - - -if __name__ == "__main__": - PORT = int(os.getenv("PORT")) if os.getenv("PORT") else 8080 - - # This is used when running locally. Gunicorn is used to run the - # application on Cloud Run. See entrypoint in Dockerfile. - app.run(host="127.0.0.1", port=PORT, debug=True)