Spaces:
Sleeping
Sleeping
BrewLA
commited on
Commit
•
1b0b385
1
Parent(s):
45405c8
added post to cors
Browse files
main.py
CHANGED
@@ -11,12 +11,13 @@ origins = [
|
|
11 |
"http://localhost:3000", # For local testing
|
12 |
]
|
13 |
|
|
|
14 |
app.add_middleware(
|
15 |
CORSMiddleware,
|
16 |
-
allow_origins=
|
17 |
allow_credentials=True,
|
18 |
-
allow_methods=["
|
19 |
-
allow_headers=["*"],
|
20 |
)
|
21 |
|
22 |
# Initialize the sentiment analysis pipeline
|
|
|
11 |
"http://localhost:3000", # For local testing
|
12 |
]
|
13 |
|
14 |
+
# Allow all origins for CORS (adjust as per your security requirements)
|
15 |
app.add_middleware(
|
16 |
CORSMiddleware,
|
17 |
+
allow_origins=["*"], # Allow requests from any origin
|
18 |
allow_credentials=True,
|
19 |
+
allow_methods=["POST"], # Allow only POST requests
|
20 |
+
allow_headers=["*"], # Allow all headers
|
21 |
)
|
22 |
|
23 |
# Initialize the sentiment analysis pipeline
|