commit 49b7c7f78e3fe5817806ee705fb54a14131d288a Author: kam (from the studio) Date: Fri Apr 22 15:00:39 2022 +0200 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eba74f4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv/ \ No newline at end of file diff --git a/app.py b/app.py new file mode 100644 index 0000000..af5b036 --- /dev/null +++ b/app.py @@ -0,0 +1,17 @@ +from flask import Flask, render_template +from flask_sock import Sock + +app = Flask(__name__) +sock = Sock(app) + + +@app.route('/') +def index(): + return render_template('index.html') + + +@sock.route('/echo') +def echo(sock): + while True: + data = sock.receive() + sock.send(data) \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..ea0292d --- /dev/null +++ b/templates/index.html @@ -0,0 +1,34 @@ + + + + Flask-Sock Demo + + +

Flask-Sock Demo

+
+
+
+ + +
+ + +