Spaces:
Sleeping
Sleeping
OMerge remote-tracking branch 'origin/main' into feat/profile
Browse files- src/main.py +10 -4
src/main.py
CHANGED
|
@@ -1,25 +1,31 @@
|
|
| 1 |
from src.profile.router import router as profile
|
| 2 |
from fastapi import FastAPI
|
| 3 |
|
| 4 |
-
|
| 5 |
from src.auth.router import router as auth_router
|
| 6 |
from src.chatbot.router import router as chatbot
|
| 7 |
from src.core.database import init_db
|
| 8 |
from src.home.router import router as home_router
|
| 9 |
from src.notifications.router import router as notifications_router
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
-
# from src.profile.router import router as profile
|
| 13 |
|
| 14 |
app = FastAPI(title="Yuvabe App API")
|
| 15 |
|
|
|
|
| 16 |
app.include_router(home_router, prefix="/home", tags=["Home"])
|
| 17 |
|
| 18 |
-
init_db()
|
| 19 |
|
| 20 |
-
|
|
|
|
| 21 |
|
| 22 |
app.include_router(profile)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
app.include_router(chatbot)
|
| 25 |
|
|
|
|
| 1 |
from src.profile.router import router as profile
|
| 2 |
from fastapi import FastAPI
|
| 3 |
|
| 4 |
+
import os
|
| 5 |
from src.auth.router import router as auth_router
|
| 6 |
from src.chatbot.router import router as chatbot
|
| 7 |
from src.core.database import init_db
|
| 8 |
from src.home.router import router as home_router
|
| 9 |
from src.notifications.router import router as notifications_router
|
| 10 |
|
| 11 |
+
from fastapi.staticfiles import StaticFiles
|
| 12 |
|
|
|
|
| 13 |
|
| 14 |
app = FastAPI(title="Yuvabe App API")
|
| 15 |
|
| 16 |
+
|
| 17 |
app.include_router(home_router, prefix="/home", tags=["Home"])
|
| 18 |
|
| 19 |
+
# init_db()
|
| 20 |
|
| 21 |
+
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 22 |
+
AUDIO_DIR = os.path.join(BASE_DIR, "static", "audio")
|
| 23 |
|
| 24 |
app.include_router(profile)
|
| 25 |
+
app.mount("/static/audio", StaticFiles(directory=AUDIO_DIR), name="audio")
|
| 26 |
+
print("Serving audio from:", AUDIO_DIR)
|
| 27 |
+
|
| 28 |
+
app.include_router(auth_router)
|
| 29 |
|
| 30 |
app.include_router(chatbot)
|
| 31 |
|