import os
import asyncio
from sanic import Sanic, response
app = Sanic(__name__)
app.socket_dict = {}
async def maintainWebSockets():
'''
Prune the list of dead websockets
'''
while True:
print(1)
asyncio.sleep(30)
@app.route('/ver', methods=['GET'])
async def catch_all(request, path=''):
return response.json({'api':'0.0.1', 'ui':'0.0.1'})
if __name__ == '__main__':
app.add_task(maintainWebSockets())
app.run(host='0.0.0.0', port='8080', debug=os.getenv('DEBUG'))