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.
22 lines
551 B
Python
22 lines
551 B
Python
import logging
|
|
|
|
from fastapi import FastAPI
|
|
from starlette.requests import Request
|
|
|
|
from app.api import api as api_router
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
app = FastAPI(title='prayertimes',
|
|
version='1.0.0',
|
|
description='An API for fetching islamic prayer times from Presidency of Religious Affairs of Turkey')
|
|
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)
|