Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EVE - define custom flask controllers [closed]

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.

like image 381
slaveq Avatar asked Feb 11 '14 11:02

slaveq


1 Answers

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

like image 62
slaveq Avatar answered Oct 03 '22 03:10

slaveq