Spaces:
Runtime error
Runtime error
Added CORS in main app
Browse files
main.py
CHANGED
@@ -24,19 +24,19 @@ output_folder = 'Output'
|
|
24 |
# Create a context variable to store the contexts for each user
|
25 |
users_context = dict()
|
26 |
|
27 |
-
#
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
|
41 |
|
42 |
### APIs
|
|
|
24 |
# Create a context variable to store the contexts for each user
|
25 |
users_context = dict()
|
26 |
|
27 |
+
# CORS (Cross-Origin Resource Sharing)
|
28 |
+
origins = [
|
29 |
+
"http://localhost",
|
30 |
+
"http://localhost:4200",
|
31 |
+
]
|
32 |
+
|
33 |
+
app.add_middleware(
|
34 |
+
CORSMiddleware,
|
35 |
+
allow_origins=["*"], # origins,
|
36 |
+
allow_credentials=True,
|
37 |
+
allow_methods=["*"],
|
38 |
+
allow_headers=["*"],
|
39 |
+
)
|
40 |
|
41 |
|
42 |
### APIs
|