|
@@ -12,7 +12,7 @@ from fastapi import FastAPI
|
|
from pydantic import BaseModel
|
|
from pydantic import BaseModel
|
|
import rpyc
|
|
import rpyc
|
|
import zhtest
|
|
import zhtest
|
|
-
|
|
|
|
|
|
+from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
|
|
class Params(BaseModel):
|
|
class Params(BaseModel):
|
|
content: str
|
|
content: str
|
|
@@ -33,6 +33,19 @@ class TTS(BaseModel):
|
|
|
|
|
|
app = FastAPI()
|
|
app = FastAPI()
|
|
|
|
|
|
|
|
+origins = [
|
|
|
|
+ "https://seo.hhh.com.tw",
|
|
|
|
+ "https://seo.googo.org",
|
|
|
|
+]
|
|
|
|
+
|
|
|
|
+app.add_middleware(
|
|
|
|
+ CORSMiddleware,
|
|
|
|
+ allow_origins=origins,
|
|
|
|
+ allow_credentials=True,
|
|
|
|
+ allow_methods=["*"],
|
|
|
|
+ allow_headers=["*"],
|
|
|
|
+)
|
|
|
|
+
|
|
@app.post("/tts/audio_to_video")
|
|
@app.post("/tts/audio_to_video")
|
|
async def audio_to_video(item: FName):
|
|
async def audio_to_video(item: FName):
|
|
print(item.fname)
|
|
print(item.fname)
|