EVE - define custom flask controllers [closed]

。_饼干妹妹 提交于 2019-12-18 05:45:07

问题


I'm using EVE for couple of days to create my own REST API but I want to have custom Flask Controller integrated with EVE is there any possibility to do this? Thanks.


回答1:


Ok I will answer my own question. After reading more about Eve, you can use any of Flask's methods because Eve is simply inheriting from the Flask class. For example, you can do this:

from eve import Eve
app = Eve()

@app.route("/x")
def hello():
    return "Hello World!"


if __name__ == '__main__':
    app.run(debug=True)

There's more info at the Flask documentation site here: Flask



来源:https://stackoverflow.com/questions/21700113/eve-define-custom-flask-controllers

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!