-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
34 lines (29 loc) · 1 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from app.routes import upload, video, dashboard, health
from dotenv import load_dotenv
import os
# Load environment variables
load_dotenv()
app = FastAPI(
title="Video Processing API",
description="A FastAPI application for video processing",
version="1.0.0",
debug=os.getenv("DEBUG", "False").lower() == "true"
)
# Mount static files directory
app.mount("/static", StaticFiles(directory="static"), name="static")
# Include routers
app.include_router(upload.router, prefix="/api", tags=["upload"])
app.include_router(video.router, prefix="/api", tags=["video"])
app.include_router(dashboard.router, tags=["dashboard"])
app.include_router(health.router)
if __name__ == "__main__":
import uvicorn
uvicorn.run(
"main:app",
host=os.getenv("HOST", "0.0.0.0"),
port=int(os.getenv("PORT", 8000)),
reload=os.getenv("DEBUG", "False").lower() == "true"
)