From f73e73ef0bb211fd50ff553162cf21ff98c7478e Mon Sep 17 00:00:00 2001 From: samerbam Date: Thu, 24 Aug 2023 23:26:16 -0400 Subject: [PATCH] inital logic for first run check --- application/main.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/application/main.py b/application/main.py index 540022d..2bd0040 100644 --- a/application/main.py +++ b/application/main.py @@ -66,6 +66,17 @@ class PrintAction(BaseModel): # return result +@app.get('/api/first_run') +def first_run(): + try: + with open('.firsttimeruncheck', 'x') as f: + f.write("") + return {"status": "First Run"} + except as e: + print(e) + return {"status": "Not First Run"} + + @app.get("/api/todos/get") def get_todos(date: str = datetime.today().strftime('%Y-%m-%d'), auth_result: str = Security(auth.verify)): """A valid access token is required to access this route"""