from fastapi import FastAPI from fastapi.responses import FileResponse from introduck.routes import create_playground_route from pathlib import Path def create_api_playground() -> FastAPI: api: FastAPI = FastAPI() @api.get("/favicon.ico") async def favicon(): cwd_path: Path = Path(__file__).parent favicon_path: Path = cwd_path / "assets" / "static" / "favicon.ico" print(f"favicon path is {favicon_path}") return FileResponse(path=favicon_path) api.mount("/", create_playground_route()) return api