simple-api-duckduckgo/main.py
Andros Fenollosa 42da7c724e Update
2024-02-08 12:52:28 +01:00

12 lines
260 B
Python

from typing import Union
from fastapi import FastAPI
from gateways.externals import DuckDuckGoGateway
from use_cases import search_ddg
app = FastAPI()
@app.get("/search/")
def api_search(q: str):
repo = DuckDuckGoGateway()
return search_ddg(repo, q)