malaknihed commited on
Commit
2a5fd9b
·
verified ·
1 Parent(s): f316ae3
Files changed (1) hide show
  1. app.py +4 -2
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=["*"], # Accepte toutes les origines (à restreindre plus tard si besoin)
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