googleit-server / handler.py
andronasef's picture
fix json structure
3e503e0
raw
history blame
318 Bytes
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)