Flask搭建简单的服务器
from gevent import pywsgi
from flask import Flask
app = Flask(__name__)
@app.route("/")
def helloworld():
return '<h1>Hello World!</h1>'
@app.route("/upload")
def upload():
return 'upload success'
@app.route("/face_detect")
def instance():
return 'succeed!'
if __name__ == '__main__':
server = pywsgi.WSGIServer(('127.0.0.1', 5000), app)
server.serve_forever()
作者:艾孜尔江
本文来自博客园,作者:艾孜尔江,转载请注明原文链接:https://www.cnblogs.com/ezhar/p/13414609.html