mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 06:57:47 +01:00
feat(app): add sentry loging
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import os
|
||||
|
||||
from fastapi import Depends, FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
@@ -9,6 +11,16 @@ from app.api.categories import router as categories_router
|
||||
from app.api.transactions import router as transactions_router
|
||||
from app.services.user_service import auth_backend, current_active_verified_user, fastapi_users, get_oauth_provider
|
||||
|
||||
|
||||
from fastapi import FastAPI
|
||||
import sentry_sdk
|
||||
|
||||
sentry_sdk.init(
|
||||
dsn=os.getenv("SENTRY_DSN"),
|
||||
send_default_pii=True,
|
||||
)
|
||||
|
||||
app = FastAPI()
|
||||
fastApi = FastAPI()
|
||||
|
||||
# CORS for frontend dev server
|
||||
@@ -59,3 +71,7 @@ async def root():
|
||||
@fastApi.get("/authenticated-route")
|
||||
async def authenticated_route(user: User = Depends(current_active_verified_user)):
|
||||
return {"message": f"Hello {user.email}!"}
|
||||
|
||||
@fastApi.get("/sentry-debug")
|
||||
async def trigger_error():
|
||||
division_by_zero = 1 / 0
|
||||
Reference in New Issue
Block a user