test api
testing api pulling from db
This commit is contained in:
parent
f0c13dc8e2
commit
4fe7f056f4
1 changed files with 8 additions and 3 deletions
|
|
@ -210,9 +210,14 @@ class ConfServer:
|
|||
async def handle_base(self, request):
|
||||
try:
|
||||
# TODO - API Options here for viewing clients, tokens, restarting the server, etc.
|
||||
text = "Bumper!"
|
||||
#text = "Bumper!"
|
||||
bots = bumper.db_get().table("bots").all()
|
||||
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(text)
|
||||
|
||||
return web.json_response(all)
|
||||
|
||||
except Exception as e:
|
||||
confserverlog.exception("{}".format(e))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue