add fastapi endpoint + deps + update dockerfile to run service instead

This commit is contained in:
Viktor Barzin 2025-06-11 20:05:26 +00:00
parent 45af54e4e4
commit 4a65664f4a
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863
4 changed files with 549 additions and 5 deletions

14
crawler/api/app.py Normal file
View file

@ -0,0 +1,14 @@
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}