Spaces:
Sleeping
Sleeping
app
Browse files
app.py
CHANGED
|
@@ -8,6 +8,9 @@ import logging
|
|
| 8 |
from fastapi.middleware.cors import CORSMiddleware
|
| 9 |
from PyPDF2 import PdfReader
|
| 10 |
import docx
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
# Configuration du logging
|
| 13 |
logging.basicConfig(level=logging.INFO)
|
|
@@ -16,12 +19,11 @@ app = FastAPI()
|
|
| 16 |
|
| 17 |
app.add_middleware(
|
| 18 |
CORSMiddleware,
|
| 19 |
-
allow_origins=["*"], #
|
| 20 |
allow_credentials=True,
|
| 21 |
allow_methods=["*"],
|
| 22 |
allow_headers=["*"],
|
| 23 |
)
|
| 24 |
-
|
| 25 |
# Servir les fichiers statiques (HTML, CSS, JS)
|
| 26 |
app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
| 27 |
|
|
|
|
| 8 |
from fastapi.middleware.cors import CORSMiddleware
|
| 9 |
from PyPDF2 import PdfReader
|
| 10 |
import docx
|
| 11 |
+
from fastapi.middleware.cors import CORSMiddleware
|
| 12 |
+
|
| 13 |
+
|
| 14 |
|
| 15 |
# Configuration du logging
|
| 16 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 19 |
|
| 20 |
app.add_middleware(
|
| 21 |
CORSMiddleware,
|
| 22 |
+
allow_origins=["*"], # Ou remplace "*" par ["https://aiwebdev-ai-web-dev.hf.space"]
|
| 23 |
allow_credentials=True,
|
| 24 |
allow_methods=["*"],
|
| 25 |
allow_headers=["*"],
|
| 26 |
)
|
|
|
|
| 27 |
# Servir les fichiers statiques (HTML, CSS, JS)
|
| 28 |
app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
| 29 |
|