File size: 928 Bytes
755aa6a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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"
        }
    ]