diff --git a/Backend/db_access.py b/Backend/db_access.py index 6ef062e..3376536 100644 --- a/Backend/db_access.py +++ b/Backend/db_access.py @@ -22,12 +22,15 @@ app = Flask(__name__) +CONNECTION = None -def db_connect(DB_URL=None): + +@app.before_request +def db_connect(DB_URL=None, connection=None): # MongoDB connection mongo_uri = DB_URL or os.environ.get("MONGO_URI") connect(alias="default", host=mongo_uri) - return True + return connection class Response: