Spaces:
Sleeping
Sleeping
Shri
commited on
Commit
·
603d27f
1
Parent(s):
e8f820d
feat:audio file added
Browse files- src/main.py +10 -6
src/main.py
CHANGED
|
@@ -1,23 +1,27 @@
|
|
| 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 |
|
| 10 |
-
# from src.profile.router import router as profile
|
| 11 |
|
| 12 |
app = FastAPI(title="Yuvabe App API")
|
| 13 |
|
|
|
|
| 14 |
app.include_router(home_router, prefix="/home", tags=["Home"])
|
| 15 |
|
| 16 |
-
init_db()
|
| 17 |
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
app.include_router(chatbot)
|
| 23 |
|
|
|
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
|
| 3 |
+
import os
|
| 4 |
from src.auth.router import router as auth_router
|
| 5 |
from src.chatbot.router import router as chatbot
|
| 6 |
from src.core.database import init_db
|
| 7 |
from src.home.router import router as home_router
|
| 8 |
+
from fastapi.staticfiles import StaticFiles
|
| 9 |
|
|
|
|
| 10 |
|
| 11 |
app = FastAPI(title="Yuvabe App API")
|
| 12 |
|
| 13 |
+
|
| 14 |
app.include_router(home_router, prefix="/home", tags=["Home"])
|
| 15 |
|
| 16 |
+
# init_db()
|
| 17 |
|
| 18 |
+
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 19 |
+
AUDIO_DIR = os.path.join(BASE_DIR, "static", "audio")
|
| 20 |
|
| 21 |
+
app.mount("/static/audio", StaticFiles(directory=AUDIO_DIR), name="audio")
|
| 22 |
+
print("Serving audio from:", AUDIO_DIR)
|
| 23 |
+
|
| 24 |
+
app.include_router(auth_router)
|
| 25 |
|
| 26 |
app.include_router(chatbot)
|
| 27 |
|