MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/cloud-code-samples / hello

Function hello

python/cloud-run-python-hello-world/app.py:13–24  ·  view source on GitHub ↗

Return a friendly HTTP greeting.

()

Source from the content-addressed store, hash-verified

11
12@app.route('/')
13def hello():
14 """Return a friendly HTTP greeting."""
15 message = "It's running!"
16
17 """Get Cloud Run environment variables."""
18 service = os.environ.get('K_SERVICE', 'Unknown service')
19 revision = os.environ.get('K_REVISION', 'Unknown revision')
20
21 return render_template('index.html',
22 message=message,
23 Service=service,
24 Revision=revision)
25
26if __name__ == '__main__':
27 server_port = os.environ.get('PORT', '8080')

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected