Files
PhotosAPI/photos_api.py

30 lines
804 B
Python
Raw Normal View History

2023-06-23 11:25:27 +02:00
import logging
2023-06-23 08:51:42 +00:00
from os import makedirs
from pathlib import Path
2023-06-22 13:17:53 +02:00
from fastapi.responses import FileResponse
2022-12-20 01:22:32 +01:00
from modules.app import app
from modules.extensions_loader import dynamic_import_from_src
2023-06-22 13:17:53 +02:00
from modules.scheduler import scheduler
2022-12-20 01:22:32 +01:00
2023-06-23 08:51:42 +00:00
makedirs(Path("data/users"), exist_ok=True)
2022-12-20 01:22:32 +01:00
2023-06-23 11:25:27 +02:00
logging.basicConfig(
level=logging.INFO,
format="%(name)s.%(funcName)s | %(levelname)s | %(message)s",
datefmt="[%X]",
)
2022-12-20 01:22:32 +01:00
@app.get("/favicon.ico", response_class=FileResponse, include_in_schema=False)
async def favicon():
return FileResponse("favicon.ico")
2023-03-12 14:59:13 +01:00
# =================================================================================
dynamic_import_from_src("extensions", star_import=True)
# =================================================================================
2022-12-20 22:24:46 +01:00
2023-03-12 14:59:13 +01:00
scheduler.start()