wrongmove/crawler/api/app.py

14 lines
370 B
Python

from fastapi import FastAPI
from repositories.listing_repository import ListingRepository
from repositories.listing_repository import ListingRepository
from database import engine
app = FastAPI()
@app.get("/listing")
async def get_listing():
repository = ListingRepository(engine)
listings = await repository.get_listings()
return {"listings": listings}