CoolFace
Apppublic

Love2021/System-Fonts

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
api.py18 linesDownload Raw Back to root
1import os2from glob import glob3from flask import Flask, jsonify4 5FONTS_DIR = "fonts"6app = Flask(__name__)7 8@app.get("/fonts")9def list_fonts():10    pattern = os.path.join(FONTS_DIR, "**")11    files = [os.path.relpath(f, FONTS_DIR) for f in glob(pattern, recursive=True)12             if os.path.isfile(f)]13    return jsonify(files)14 15# Optional root route so the Space landing page doesn’t 40416@app.get("/")17def root():18    return {"message": "Font API is running", "endpoint": "/fonts"}