Closed Luo-hongyi closed 4 months ago
...
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["https://app.nextchat.dev"],
allow_credentials=True,
allow_methods=["GET", "POST", "OPTIONS"],
allow_headers=["Content-Type", "Authorization"],
)
Access to fetch at 'http://localhost:8765/v1/chat/completions' from origin 'https://app.nextchat.dev/' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.