Skip to content
This repository was archived by the owner on Oct 23, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 47 additions & 42 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Requires Python 3.6+.
```bash
pip install bocadillo python-socketio
# OR
pipenv install
pipenv install --pre
```

- Node.js dependencies:
Expand All @@ -30,7 +30,7 @@ npm install
1. Fire off the server:

```bash
python app.py
uvicorn app:app
```

2. Open up a web browser at http://localhost:8000, and start chatting!
Expand Down
7 changes: 2 additions & 5 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import socketio
from bocadillo import App, Templates, static
from bocadillo import App, configure, Templates, static

app = App()
configure(app)
templates = Templates(app)

# Create a socket.io async server.
Expand Down Expand Up @@ -39,7 +40,3 @@ async def handle_message(sid, data: str):
# Broadcast the received message to all connected clients.
# See: https://python-socketio.readthedocs.io/en/latest/server.html#emitting-events
await sio.emit("response", data)


if __name__ == "__main__":
app.run()