标签:
from flask import Flask app = Flask(__name__) @app.route(‘/hello.world‘) def check(): return ‘hello world!‘ if __name__ == ‘__main__‘: app.run(debug=False, host=‘0.0.0.0‘, port=80) #指定了费debug模式,外部可访问的服务器,端口
$curl http://10.177.80.30:80/hello.world hello world!
from flask import Flask app = Flask(__name__) @app.route(‘/hello.world‘) def check(): return 200 if __name__ == ‘__main__‘: app.run(debug=False, host=‘0.0.0.0‘, port=80)
注:返回值不可为整数
参考:http://docs.jinkan.org/docs/flask/quickstart.html
标签:
原文地址:http://www.cnblogs.com/kaituorensheng/p/5088978.html