lots of work done, dashboards added
This commit is contained in:
+7
-1
@@ -3,9 +3,10 @@
|
||||
import os
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
from database import engine, Base
|
||||
from pathlib import Path
|
||||
|
||||
import routers.bootstrap
|
||||
import routers.auth
|
||||
import routers.clients
|
||||
import routers.workout_types
|
||||
@@ -14,6 +15,10 @@ import routers.exercises
|
||||
import routers.metrics
|
||||
import routers.sync
|
||||
|
||||
# Создаем директорию для БД, если её нет
|
||||
db_path = os.getenv("GYM_DB_PATH", "./gym.db")
|
||||
Path(db_path).parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Гарантируем, что директория существует
|
||||
os.makedirs(os.path.dirname(os.getenv("GYM_DB_PATH", "./gym.db")), exist_ok=True)
|
||||
|
||||
@@ -41,6 +46,7 @@ app.include_router(routers.workouts.router)
|
||||
app.include_router(routers.exercises.router)
|
||||
app.include_router(routers.metrics.router)
|
||||
app.include_router(routers.sync.router)
|
||||
app.include_router(routers.bootstrap.router)
|
||||
|
||||
|
||||
@app.get("/")
|
||||
|
||||
Reference in New Issue
Block a user