Make example use the PORT env var instead of 8080 (#415)

This commit is contained in:
Naomi Seyfer 2018-09-25 12:08:20 -07:00 committed by Knative Prow Robot
parent 0be86f6ff2
commit acd1adff92
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ The following instructions recreate the source files from this folder.
return 'Hello World: {}!\n'.format(target)
if __name__ == "__main__":
app.run(debug=True,host='0.0.0.0',port=8080)
app.run(debug=True,host='0.0.0.0',port=int(os.environ.get('PORT', 8080)))
```
1. Create a file named `Dockerfile` and copy the code block below into it.

View File

@ -10,4 +10,4 @@ def hello_world():
return 'Hello World: {}!\n'.format(target)
if __name__ == "__main__":
app.run(debug=True,host='0.0.0.0',port=8080)
app.run(debug=True,host='0.0.0.0',port=int(os.environ.get('PORT', 8080)))