我有一个 AWS 实例正在运行。通过 SimpleHTTPServer 提供服务是可行的。
[ec2-user@ip-XXXXX ~]$ python -m SimpleHTTPServer 8080
Serving HTTP on 0.0.0.0 port 8080 ...
p54A5C877.dip0.t-XXX.org - - [07/Mar/2013 12:36:45] "GET / HTTP/1.1" 200 -
但是随后使用烧瓶,请求不会以某种方式通过。
>>> from flask import Flask
>>>
>>> app = Flask(__name__)
>>>
>>> @app.route('/')
... def hello_world():
... return 'Hello World!'
...
>>> if __name__ == '__main__':
... app.run(port=8080)
...
* Running on http://127.0.0.1:8080/ => no request catched