feat: deploy heroku test app

This commit is contained in:
2021-07-01 01:49:30 -04:00
parent 5227cacb75
commit eb55836e4b
2 changed files with 6 additions and 3 deletions

1
Procfile Normal file
View File

@@ -0,0 +1 @@
web: python main.py

View File

@@ -1,13 +1,15 @@
#!/usr/bin/env python
import asyncio
import os
import websockets
async def echo(websocket, path):
async for message in websocket:
await websocket.send(message)
asyncio.get_event_loop().run_until_complete(
websockets.serve(echo, "", 5000))
print("starting websocket...")
start_server = websockets.serve(echo, "", int(os.environ["PORT"]))
asyncio.get_event_loop().run_until_complete(start_server)
asyncio.get_event_loop().run_forever()