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.
Baca Juga
- How Can I Use Kubernetes Python Api To Get Clusters Information?
- Raise Imgurclienterror('json Decoding Of Response Failed.') Imgurpython.helpers.error.imgurclienterror: Json Decoding Of Response Failed
- How To Add Condition For Particular Class To Show Field Drop -down Except Partner_id From Res.partner Form
Post a Comment for "Rest Api Framework That Works With My Python Program Instead Of Database"