Created
November 24, 2019 18:41
-
-
Save barrachri/8a493ec0d92342406b4ed256e9d2ba43 to your computer and use it in GitHub Desktop.
Python application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######### Cloud Run | |
import os | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
target = os.environ.get('TARGET', 'World') | |
return 'Hello {}!\n'.format(target) | |
if __name__ == "__main__": | |
app.run(debug=False, host='0.0.0.0', port=int(os.environ.get('PORT', 8080))) | |
######### Cloud Function | |
import os | |
def hello_world(request): | |
target = os.environ.get('TARGET', 'World') | |
return 'Hello {}!\n'.format(target) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment