Update app.py
Browse files
app.py
CHANGED
@@ -5,23 +5,15 @@ import uvicorn
|
|
5 |
from fastapi.middleware.cors import CORSMiddleware
|
6 |
|
7 |
app = FastAPI()
|
8 |
-
|
9 |
-
#
|
10 |
-
origins = [ "http://localhost",
|
11 |
-
"http://localhost:8000",
|
12 |
-
"https://huggingface.co/mgokg",
|
13 |
-
# Füge hier weitere Ursprünge hinzu
|
14 |
-
]
|
15 |
-
|
16 |
app.add_middleware(
|
17 |
-
CORSMiddleware,
|
18 |
-
allow_origins=origins,
|
19 |
allow_credentials=True,
|
20 |
allow_methods=["*"],
|
21 |
-
allow_headers=["*"],
|
22 |
)
|
23 |
|
24 |
-
|
25 |
class Item(BaseModel):
|
26 |
prompt: str
|
27 |
zeitstempel: int
|
|
|
5 |
from fastapi.middleware.cors import CORSMiddleware
|
6 |
|
7 |
app = FastAPI()
|
8 |
+
|
9 |
+
# Erlaubt alle Ursprünge
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
app.add_middleware(
|
11 |
+
CORSMiddleware, allow_origins=["*"],
|
|
|
12 |
allow_credentials=True,
|
13 |
allow_methods=["*"],
|
14 |
+
allow_headers=["*"],
|
15 |
)
|
16 |
|
|
|
17 |
class Item(BaseModel):
|
18 |
prompt: str
|
19 |
zeitstempel: int
|