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()




作者:艾孜尔江

posted @ 2020-08-01 14:49  艾孜尔江  阅读(400)  评论(0编辑  收藏  举报