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 import Eve
app = 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"