Coverage for src / main.py: 100%

14 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-05-10 22:03 +0200

1import uvicorn 

2from fastapi import FastAPI 

3from src.auth.auth import auth_backend 

4from src.auth.schemas import UserRead, UserCreate 

5from src.auth.manager import fastapi_users 

6from src.links.routers import router as links_router 

7from src.auth.models import User # noqa: F401 

8from src.links.models import Link # noqa: F401 

9from fastapi.middleware.cors import CORSMiddleware 

10 

11app = FastAPI() 

12 

13app.add_middleware( 

14 CORSMiddleware, 

15 allow_origins=["*"], 

16 allow_credentials=True, 

17 allow_methods=["*"], 

18 allow_headers=["*"], 

19) 

20 

21app.include_router( 

22 fastapi_users.get_auth_router(auth_backend), prefix="/auth/jwt", tags=["auth"] 

23) 

24app.include_router( 

25 fastapi_users.get_register_router(UserRead, UserCreate), 

26 prefix="/auth", 

27 tags=["auth"], 

28) 

29 

30app.include_router(links_router)