vendredi 23 octobre 2020

How to create a private endpoint in flask

In my flask application I need to fetch data from my database whenever the users clicks a button, I know I can just make a flask route, using the flask restful module or plain routes. But my question is if I can make that route/endpoint not visible for users.

@app.route("/api/fetch/")
def fetch_data():
    return some_data

I dont wan't the user having access to this endpoint directly, I just want the web application to be able to use it. Not sure if it is possible or where to look.

I found that maybe using Flask-CORS could help. Any help or guidance would be appreciated.




Aucun commentaire:

Enregistrer un commentaire