diff --git a/api/main.py b/api/main.py index 0fc6f58..bc56c8e 100644 --- a/api/main.py +++ b/api/main.py @@ -15,6 +15,7 @@ fundamental to scalable microservices architecture. from fastapi import FastAPI, Depends, HTTPException, status from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials +from fastapi.middleware.cors import CORSMiddleware from pydantic import BaseModel from jose import jwt, JWTError from kafka import KafkaProducer @@ -129,6 +130,15 @@ app = FastAPI( version="1.0.0" ) +# Add CORS middleware to allow requests from frontend +app.add_middleware( + CORSMiddleware, + allow_origins=["http://localhost:3000", "http://127.0.0.1:3000"], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], +) + @app.get("/health") async def health_check(): """Health check endpoint""" diff --git a/consumer/__pycache__/decision.cpython-314.pyc b/consumer/__pycache__/decision.cpython-314.pyc new file mode 100644 index 0000000..9e4b8ad Binary files /dev/null and b/consumer/__pycache__/decision.cpython-314.pyc differ diff --git a/consumer/__pycache__/models.cpython-314.pyc b/consumer/__pycache__/models.cpython-314.pyc new file mode 100644 index 0000000..c943326 Binary files /dev/null and b/consumer/__pycache__/models.cpython-314.pyc differ diff --git a/consumer/__pycache__/pipeline.cpython-314.pyc b/consumer/__pycache__/pipeline.cpython-314.pyc new file mode 100644 index 0000000..ec8ae9b Binary files /dev/null and b/consumer/__pycache__/pipeline.cpython-314.pyc differ