FonsFlip / app.py
fugthchat's picture
Create app.py
755aa6a verified
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
@app.get("/")
def root():
return {"status": "FonsFlip backend running"}
# Listings (mock for now)
@app.get("/listings")
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"
}
]