Created content endpoint to serve files from content directory

This commit is contained in:
2025-05-05 16:14:13 -05:00
parent 2ad1d713cb
commit cc95e35c7f
8 changed files with 78 additions and 52 deletions

View File

@@ -1,16 +1,6 @@
import aiosqlite
import os
from dotenv import load_dotenv
load_dotenv()
DATABASE_PATH = os.getenv("DATABASE_PATH", "users.db")
# Ensure the directory for the database exists
db_dir = os.path.dirname(DATABASE_PATH)
if db_dir and not os.path.exists(db_dir):
print(f"Creating directory for database: {DATABASE_PATH}")
os.makedirs(db_dir, exist_ok=True)
from config import DATABASE_PATH
async def get_db():
async with aiosqlite.connect(DATABASE_PATH) as db: