15 lines
370 B
Python
15 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}
|