From 76a10c9d8a87837fc240facb9957f6814b878f98 Mon Sep 17 00:00:00 2001 From: simoma02 <151738191+simoma02@users.noreply.github.com> Date: Wed, 10 Jul 2024 17:47:38 +0200 Subject: [PATCH] Fix CORS Middleware --- server.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index b899b81..be2e6b1 100644 --- a/server.py +++ b/server.py @@ -17,8 +17,7 @@ # io = gr.Interface(lambda x: "Hello, " + x + "!", "textbox", "textbox") -def add(app: FastAPI): - app.add_middleware( +app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, @@ -59,4 +58,4 @@ def main(): uvicorn.run("server:app", host=args.host, port=args.port , reload=args.reload) if __name__ == "__main__": - main() \ No newline at end of file + main()