VishwaTechnologiesPvtLtd commited on
Commit
002bb9e
·
1 Parent(s): e7077fc

changes in app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -8,19 +8,24 @@ app = FastAPI(title="Multi-layered FastAPI Example")
8
 
9
  # Allow requests from your frontend origin
10
  origins = [
11
- "http://localhost:3000", # React frontend
12
  # Add more origins if needed
13
  ]
14
 
15
  app.add_middleware(
16
  CORSMiddleware,
17
- allow_origins=origins, # List of allowed origins
18
  allow_credentials=True,
19
- allow_methods=["*"], # Allow all HTTP methods (GET, POST, etc.)
20
- allow_headers=["*"], # Allow all headers
21
  )
22
 
23
-
24
  app.include_router(items.router)
25
  app.include_router(pdfreader.router)
26
- app.include_router(textreader.router)
 
 
 
 
 
 
8
 
9
  # Allow requests from your frontend origin
10
  origins = [
11
+ "*", # React frontend
12
  # Add more origins if needed
13
  ]
14
 
15
  app.add_middleware(
16
  CORSMiddleware,
17
+ allow_origins=origins,
18
  allow_credentials=True,
19
+ allow_methods=["*"],
20
+ allow_headers=["*"],
21
  )
22
 
23
+ # Include routers
24
  app.include_router(items.router)
25
  app.include_router(pdfreader.router)
26
+ app.include_router(textreader.router)
27
+
28
+ # Run app with Uvicorn
29
+ if __name__ == "__main__":
30
+ import uvicorn
31
+ uvicorn.run("app:app", host="0.0.0.0", port=7860, reload=True)