i've build a simple flask app on my google cloud GCE instance, but i can't access it from another computer, here's the simple flask app that i've build:
from flask import Flask, render_template, request, json, abort
app = Flask(__name__)
@app.route('/', methods=['GET'])
def heartbeat():
return 'hello'
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
and when i run the app
and access the external IP of my machine it only said this site can't be reached i have set up a new firewall rule
but it still not working.
这是因为您必须将端口更改为 80 而不是 5000
with me it was the silly problem that when you click on the link to the external IP on the GCP console you get send to https://34.##.#.## and that doesn't work but if you go to 34.##.#.##:5000 it did work for me. Also doing a "curl 34.##.#.##:5000" on linux also works for me
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.