garvitcpp commited on
Commit
eb66dc5
·
verified ·
1 Parent(s): 8b7704f

Update app/__init__.py

Browse files
Files changed (1) hide show
  1. app/__init__.py +14 -14
app/__init__.py CHANGED
@@ -1,15 +1,15 @@
1
- from fastapi import FastAPI
2
- from fastapi.middleware.cors import CORSMiddleware
3
-
4
- def create_app() -> FastAPI:
5
- app = FastAPI(title="File Sharing API")
6
-
7
- app.add_middleware(
8
- CORSMiddleware,
9
- allow_origins=[""],
10
- allow_credentials=True,
11
- allow_methods=[""],
12
- allow_headers=["*"],
13
- )
14
-
15
  return app
 
1
+ from fastapi import FastAPI
2
+ from fastapi.middleware.cors import CORSMiddleware
3
+
4
+ def create_app() -> FastAPI:
5
+ app = FastAPI(title="File Sharing API")
6
+
7
+ app.add_middleware(
8
+ CORSMiddleware,
9
+ allow_origins=["*"], # Replace with your frontend URL in production
10
+ allow_credentials=True,
11
+ allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"],
12
+ allow_headers=["*"],
13
+ )
14
+
15
  return app