File size: 1,041 Bytes
f2638df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98ccc92
 
f2638df
 
 
 
 
 
 
 
 
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
35
36
37
import uvicorn
import logging
import sys
from fastapi import FastAPI
from app.api.image_router import router as image_router

# --- Logging Configuration ---
# We configure logging to output to stdout (standard output)
# This is best practice for services, as the environment (like Docker or Uvicorn)
# can then capture and manage the logs.
logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
    handlers=[logging.StreamHandler(sys.stdout)]
)
# ---

# Get a logger for this file
logger = logging.getLogger(__name__)

# Initialize the FastAPI app
app = FastAPI(title="Image Generation & Update API")

# Include your API routers
app.include_router(image_router)

hi

# 1. Root endpoint
@app.get("/")
async def root():
    logger.info("Root endpoint '/' was hit")
    return {"message": "Welcome to the Image Generation API! Visit /docs for API documentation."}

# --- Run the app ---
if __name__ == "__main__":
    uvicorn.run("app.main:app", host="0.0.0.0", port=8000, reload=True)