# app.py # # Hugging Face Spaces ➜ Build type: "FastAPI" (Python) # 실행 시 http:/// 로 접속하면 FlipBook UI가 표시됩니다. from fastapi import FastAPI from fastapi.responses import HTMLResponse from fastapi.staticfiles import StaticFiles import pathlib BASE = pathlib.Path(__file__).parent app = FastAPI() # ── 1. 같은 폴더의 정적 파일(js / css / img / mp3 등)을 /static 경로로 서빙 app.mount("/static", StaticFiles(directory=BASE), name="static") # ── 2. index.html 소스 (script/link 경로만 /static/ 로 바꿈) INDEX_HTML = """ FlipBook – 업로드 + 내장 사운드

Real3D FlipBook – 이미지 업로드 + 사운드 ✨

""" # ── 3. 라우터: GET / → index.html 반환 @app.get("/", response_class=HTMLResponse) async def root(): return INDEX_HTML