Spaces:
Sleeping
Sleeping
File size: 318 Bytes
d5f1b3e 3e503e0 d5f1b3e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import json
from search import search
from suggest import suggest
def handler(action, query):
action = action.lower()
res = {"msg": "Failed to handle request"}
if action == "search":
res = search(query)
elif action == "autosuggest":
res = suggest(query)
return json.dumps(res)
|