You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
356 B
Python
17 lines
356 B
Python
from fastapi import FastAPI
|
|
from loguru import logger
|
|
from starlette.requests import Request
|
|
|
|
from app.api import api as api_router
|
|
|
|
app = FastAPI()
|
|
app.include_router(api_router, prefix='/api')
|
|
|
|
|
|
@app.exception_handler(Exception)
|
|
async def log_exceptions(req: Request, err: Exception):
|
|
try:
|
|
raise err
|
|
except:
|
|
logger.exception(err)
|