Re-org and start of API #47

Merged
bmartin5692 merged 10 commits from wip_dev into master 2019-06-21 03:26:06 +02:00
Showing only changes of commit 4fe7f056f4 - Show all commits

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))