diff --git a/.gitignore b/.gitignore index b1781e0..9967b6b 100644 --- a/.gitignore +++ b/.gitignore @@ -162,4 +162,5 @@ cython_debug/ .creds tools/*.json .devcontainer -app/*.json \ No newline at end of file +app/*.json +app/flash \ No newline at end of file diff --git a/app/main.py b/app/main.py index c48ddb8..d7c4a59 100644 --- a/app/main.py +++ b/app/main.py @@ -4,6 +4,7 @@ from fastapi.middleware.cors import CORSMiddleware from .dependencies import load_animeguess_anime_list from .routers import animeguess +from .routers import flash # Load anime list load_animeguess_anime_list() @@ -21,6 +22,7 @@ app.add_middleware( # Routes app.include_router(animeguess.router) +app.include_router(flash.router) # Health check @app.get("/ping") diff --git a/app/routers/flash.py b/app/routers/flash.py new file mode 100644 index 0000000..63bde68 --- /dev/null +++ b/app/routers/flash.py @@ -0,0 +1,17 @@ +import os + +from fastapi import APIRouter + +import json + +router = APIRouter() + +@router.get("/get-flash-files") +async def get_flash_files(): + + # Flash files directory + FLASH_DIR = os.getenv('FLASH_DIR') + + files_list = os.listdir(FLASH_DIR) + + return {"files":files_list} \ No newline at end of file