Update app/main.py
Browse files- app/main.py +10 -0
app/main.py
CHANGED
|
@@ -5,6 +5,16 @@ from tensorflow import keras
|
|
| 5 |
import os
|
| 6 |
|
| 7 |
app = FastAPI()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# Debug: print current directory and files
|
| 10 |
print("Current working directory:", os.getcwd())
|
|
|
|
| 5 |
import os
|
| 6 |
|
| 7 |
app = FastAPI()
|
| 8 |
+
from fastapi.middleware.cors import CORSMiddleware
|
| 9 |
+
|
| 10 |
+
origins = ["*"] # allow all, or ["https://<your-github-username>.github.io"]
|
| 11 |
+
|
| 12 |
+
app.add_middleware(
|
| 13 |
+
CORSMiddleware,
|
| 14 |
+
allow_origins=origins,
|
| 15 |
+
allow_methods=["*"],
|
| 16 |
+
allow_headers=["*"],
|
| 17 |
+
)
|
| 18 |
|
| 19 |
# Debug: print current directory and files
|
| 20 |
print("Current working directory:", os.getcwd())
|