Ali Noor commited on
Commit
1f34ff7
·
1 Parent(s): 76bd420

Add the Login Screen and use can login according to their rolls and have screen according to the rolls

Browse files
Files changed (1) hide show
  1. app/main.py +9 -0
app/main.py CHANGED
@@ -1,4 +1,5 @@
1
  from fastapi import FastAPI
 
2
  from sqlalchemy import text
3
 
4
 
@@ -13,6 +14,14 @@ from app.routes.departments import router as departments_router
13
 
14
  app = FastAPI(title=settings.app_name)
15
 
 
 
 
 
 
 
 
 
16
  app.include_router(auth_router)
17
  app.include_router(admin_router)
18
  app.include_router(departments_router)
 
1
  from fastapi import FastAPI
2
+ from fastapi.middleware.cors import CORSMiddleware
3
  from sqlalchemy import text
4
 
5
 
 
14
 
15
  app = FastAPI(title=settings.app_name)
16
 
17
+ app.add_middleware(
18
+ CORSMiddleware,
19
+ allow_origins=["http://localhost:5173", "http://127.0.0.1:5173"],
20
+ allow_credentials=True,
21
+ allow_methods=["*"],
22
+ allow_headers=["*"],
23
+ )
24
+
25
  app.include_router(auth_router)
26
  app.include_router(admin_router)
27
  app.include_router(departments_router)