36 Chapter 2: Cloud Computing Foundations
15. You can test out passing in parameters to exercise this function:
1 @app.route('/name/<value>')
2 def name(value):
3 val = {"value": value}
4 return jsonify(val)
For example, calling this route will take the word lion and pass into the Flask application’s name
function.
1 https://8080-dot-3104625-dot-devshell.appspot.com/name/lion
is step returns the value in a web browser:
1 {
2 value: "lion"
3 }
16. Now deploy the app
1 gcloud app deploy
Warning the first deployment could take about 10 minutes
FYI‼! You may also need to enable cloud build API.
1 Do you want to continue (Y/n)? y
2 Beginning deployment of service [default]
3 ...Uploading 934 files to Google Cloud Storage...
17. Now stream the log files.
1 gcloud app ...