|
@@ -6,9 +6,15 @@ import json
|
|
|
import uvicorn
|
|
|
import zipfile
|
|
|
|
|
|
-
|
|
|
+from fastapi.middleware.cors import CORSMiddleware
|
|
|
app = FastAPI()
|
|
|
-
|
|
|
+app.add_middleware(
|
|
|
+ CORSMiddleware,
|
|
|
+ allow_origins=['*'],
|
|
|
+ allow_credentials=True,
|
|
|
+ allow_methods=["*"],
|
|
|
+ allow_headers=["*"],
|
|
|
+)
|
|
|
@app.get("/getbtn")
|
|
|
def read_root(request: Request):
|
|
|
r = redis.Redis(host='db.ptt.cx', port=6379, db=2,password='choozmo9')
|