refactoring some code by removing unnecessary checks and moving tests block to root /

This commit is contained in:
2026-07-24 17:13:37 +03:00
parent 26b857ed84
commit 1d25b0edc3
9 changed files with 35 additions and 15 deletions

13
main.py
View File

@@ -1,5 +1,6 @@
from fastapi import FastAPI
from src.web.protected_routes.routes import router as protected_router
from pathlib import Path
import uvicorn
app=FastAPI(root_path="/")
@@ -9,7 +10,19 @@ app.include_router(router=protected_router)
def root()->dict:
return {"root":"hello, this is root"}
def create_dirs():
dirs_to_create=("./DB",
"./upload",
"./upload_bad",
"./upload_finished")
for x in dirs_to_create:
Path(x).mkdir(parents=True, exist_ok=True)
def main():
create_dirs()
uvicorn.run("main:app", reload=True)
if __name__=="__main__":