File size: 668 Bytes
c2fb4c6
 
 
 
 
 
 
 
 
 
 
 
 
 
9037654
c2fb4c6
 
 
 
 
 
 
 
 
 
 
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
from fastapi import FastAPI
from routes import predictions
from fastapi.middleware.cors import CORSMiddleware


app = FastAPI()

origins = [
    "http://127.0.0.1:5173", # Add Vite default port
    "http://localhost:5173",
    "http://127.0.0.1:5501", 
    "http://localhost:5501",
    "http://127.0.0.1:5500",
    "http://localhost:5500",
    "https://agro-vision-frontend.vercel.app"
]

app.add_middleware(
    CORSMiddleware,
    allow_origins=origins,  # Allows specific origins
    allow_credentials=True,
    allow_methods=["*"],    # Allows all methods (GET, POST, etc.)
    allow_headers=["*"],    # Allows all headers
)

app.include_router(predictions.router)