Spaces:
Sleeping
Sleeping
Update app.py
Browse filesMaking public API
app.py
CHANGED
|
@@ -23,17 +23,12 @@ class EmailRequest(BaseModel):
|
|
| 23 |
app = FastAPI(title="Phishing Detection API")
|
| 24 |
|
| 25 |
# Define the specific origins that are allowed to call this API
|
| 26 |
-
|
| 27 |
-
"http://localhost:3000", # React/Frontend local development
|
| 28 |
-
"http://127.0.0.1:5500", # VS Code Live Server default
|
| 29 |
-
"http://127.0.0.1:8500", # Your FastAPI local address
|
| 30 |
-
"http://localhost:5500", # Alternative Live Server address
|
| 31 |
-
]
|
| 32 |
|
| 33 |
app.add_middleware(
|
| 34 |
CORSMiddleware,
|
| 35 |
-
allow_origins=
|
| 36 |
-
allow_credentials=
|
| 37 |
allow_methods=["*"], # Allows all HTTP methods (POST, GET, etc.)
|
| 38 |
allow_headers=["*"], # Allows all headers (Content-Type, etc.)
|
| 39 |
)
|
|
|
|
| 23 |
app = FastAPI(title="Phishing Detection API")
|
| 24 |
|
| 25 |
# Define the specific origins that are allowed to call this API
|
| 26 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
app.add_middleware(
|
| 29 |
CORSMiddleware,
|
| 30 |
+
allow_origins=["*"], # Only allow the domains in the list above
|
| 31 |
+
allow_credentials=False,
|
| 32 |
allow_methods=["*"], # Allows all HTTP methods (POST, GET, etc.)
|
| 33 |
allow_headers=["*"], # Allows all headers (Content-Type, etc.)
|
| 34 |
)
|