add fastapi endpoint + deps + update dockerfile to run service instead
This commit is contained in:
parent
45af54e4e4
commit
4a65664f4a
4 changed files with 549 additions and 5 deletions
14
crawler/api/app.py
Normal file
14
crawler/api/app.py
Normal 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}
|
||||
Loading…
Add table
Add a link
Reference in a new issue