Skip to content Skip to sidebar Skip to footer

Rest Api Framework That Works With My Python Program Instead Of Database

I wanted to create a very simple REST API. I found EVE Framework very promising and I want to instead of using a Database. import my .py code and execute it and return the string.

Solution 1:

If I got your question right yes, you can mount custom endpoints on top of a Eve REST API. Not a long ago I wrote an article about this, check it out for the details, but it really boils down to doing something like this:

from eve importEveapp= Eve()

@app.route('/hello')
def hello_world():
    return'Hello World!'if__name__== '__main__':
    app.run()

This is just leveraging the standard Flask features. Then you can access the /hello endpoint where your function will do whatever it needs to do.

Post a Comment for "Rest Api Framework That Works With My Python Program Instead Of Database"