Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -16,16 +16,16 @@ VALID_IMAGE_EXTENSIONS = {"jpg", "jpeg", "png"}
|
|
| 16 |
|
| 17 |
app = FastAPI()
|
| 18 |
# CORS issue write below code
|
| 19 |
-
origins = [
|
| 20 |
-
|
| 21 |
-
]
|
| 22 |
-
app.add_middleware(
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
)
|
| 29 |
# ==========================
|
| 30 |
api_key_header = APIKeyHeader(name="api_key", auto_error=False)
|
| 31 |
|
|
|
|
| 16 |
|
| 17 |
app = FastAPI()
|
| 18 |
# CORS issue write below code
|
| 19 |
+
# origins = [
|
| 20 |
+
# "http://localhost:3000", # Update this with the actual origin of your frontend
|
| 21 |
+
# ]
|
| 22 |
+
# app.add_middleware(
|
| 23 |
+
# CORSMiddleware,
|
| 24 |
+
# allow_origins=origins,
|
| 25 |
+
# allow_credentials=True,
|
| 26 |
+
# allow_methods=["*"],
|
| 27 |
+
# allow_headers=["*"],
|
| 28 |
+
# )
|
| 29 |
# ==========================
|
| 30 |
api_key_header = APIKeyHeader(name="api_key", auto_error=False)
|
| 31 |
|