Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,19 @@ from fastapi import FastAPI, Header
|
|
5 |
import html2text
|
6 |
import requests
|
7 |
|
|
|
|
|
|
|
8 |
app = FastAPI()
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
@app.get("/tiktok_details/")
|
12 |
async def read_item(username: str, video_id:str):
|
|
|
5 |
import html2text
|
6 |
import requests
|
7 |
|
8 |
+
from fastapi.middleware.cors import CORSMiddleware
|
9 |
+
|
10 |
+
|
11 |
app = FastAPI()
|
12 |
|
13 |
+
app.add_middleware(
|
14 |
+
CORSMiddleware,
|
15 |
+
allow_origins=["*"],
|
16 |
+
allow_credentials=True,
|
17 |
+
allow_methods=["*"],
|
18 |
+
allow_headers=["*"],
|
19 |
+
)
|
20 |
+
|
21 |
|
22 |
@app.get("/tiktok_details/")
|
23 |
async def read_item(username: str, video_id:str):
|