Update app.py
Browse files
app.py
CHANGED
@@ -5,11 +5,19 @@ import sys
|
|
5 |
import uvicorn
|
6 |
from imagekitio import ImageKit
|
7 |
from imagekitio.models.ListAndSearchFileRequestOptions import ListAndSearchFileRequestOptions
|
|
|
8 |
|
9 |
import base64
|
10 |
|
11 |
app = FastAPI()
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
|
15 |
imagekit = ImageKit(
|
|
|
5 |
import uvicorn
|
6 |
from imagekitio import ImageKit
|
7 |
from imagekitio.models.ListAndSearchFileRequestOptions import ListAndSearchFileRequestOptions
|
8 |
+
from fastapi.middleware.cors import CORSMiddleware
|
9 |
|
10 |
import base64
|
11 |
|
12 |
app = FastAPI()
|
13 |
+
# Configure CORS
|
14 |
+
app.add_middleware(
|
15 |
+
CORSMiddleware,
|
16 |
+
allow_origins=["*"], # Allows all origins
|
17 |
+
allow_credentials=True,
|
18 |
+
allow_methods=["*"], # Allows all methods
|
19 |
+
allow_headers=["*"], # Allows all headers
|
20 |
+
)
|
21 |
|
22 |
|
23 |
imagekit = ImageKit(
|