Amaro2a commited on
Commit
8d5cd96
·
verified ·
1 Parent(s): ac80bb1

Update app.py

Browse files

cors to all some origins

Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -12,13 +12,6 @@ from fastapi.middleware.cors import CORSMiddleware
12
 
13
 
14
 
15
- app.add_middleware(
16
- CORSMiddleware,
17
- allow_origins=["*"], # Or specify your frontend's URL
18
- allow_credentials=True,
19
- allow_methods=["*"],
20
- allow_headers=["*"],
21
- )
22
 
23
  # ==================================
24
  # Setup: App, Logging, Constants
@@ -28,6 +21,15 @@ app = FastAPI(
28
  description="The Flake API to generate images using a Stable Diffusion model fine-tuned with LoRA.",
29
  )
30
 
 
 
 
 
 
 
 
 
 
31
  logging.basicConfig(
32
  level=logging.INFO,
33
  format="%(asctime)s - %(levelname)s - %(message)s",
 
12
 
13
 
14
 
 
 
 
 
 
 
 
15
 
16
  # ==================================
17
  # Setup: App, Logging, Constants
 
21
  description="The Flake API to generate images using a Stable Diffusion model fine-tuned with LoRA.",
22
  )
23
 
24
+ app.add_middleware(
25
+ CORSMiddleware,
26
+ allow_origins=["*"], # Or specify your frontend's URL
27
+ allow_credentials=True,
28
+ allow_methods=["*"],
29
+ allow_headers=["*"],
30
+ )
31
+
32
+
33
  logging.basicConfig(
34
  level=logging.INFO,
35
  format="%(asctime)s - %(levelname)s - %(message)s",