testing api pulling from db
This commit is contained in:
Brian Martin 2019-06-18 20:21:01 -04:00
parent f0c13dc8e2
commit 4fe7f056f4

View file

@ -210,9 +210,14 @@ class ConfServer:
async def handle_base(self, request): async def handle_base(self, request):
try: try:
# TODO - API Options here for viewing clients, tokens, restarting the server, etc. # TODO - API Options here for viewing clients, tokens, restarting the server, etc.
text = "Bumper!" #text = "Bumper!"
bots = bumper.db_get().table("bots").all()
return web.json_response(text) clients = bumper.db_get().table("clients").all()
helperbot = self.helperbot.Client.session.transitions.state
all = {'bots':bots, 'clients':clients, 'helperbot': [{'state': helperbot}]}
return web.json_response(all)
except Exception as e: except Exception as e:
confserverlog.exception("{}".format(e)) confserverlog.exception("{}".format(e))