Download app.py from fugthchat/FonsFlip: direct link, hf CLI and curl.
- Browser
- Download file 928 Bytes
-
https://huggingface.co/spaces/fugthchat/FonsFlip/resolve/main/app.py
- Command line
-
hf download hf://spaces/fugthchat/FonsFlip/app.py
-
curl -L -o app.py https://huggingface.co/spaces/fugthchat/FonsFlip/resolve/main/app.py
928 Bytes
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| app = FastAPI(title="FonsFlip API") | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], # later lock to github.io | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| # Health check | |
| def root(): | |
| return {"status": "FonsFlip backend running"} | |
| # Listings (mock for now) | |
| def listings(): | |
| return [ | |
| { | |
| "id": 1, | |
| "title": "Jordan 4 Retro Black Cat", | |
| "price": 620, | |
| "location": "Boston, MA", | |
| "image": "https://images.unsplash.com/photo-1600185365483-26d7a4cc7519?w=600" | |
| }, | |
| { | |
| "id": 2, | |
| "title": "Supreme Box Logo Hoodie", | |
| "price": 380, | |
| "location": "Cambridge, MA", | |
| "image": "https://images.unsplash.com/photo-1521335629791-ce4aec67dd47?w=600" | |
| } | |
| ] | |