Commit 184599fe authored by onny's avatar onny

auto reload template

parent 57664629
Pipeline #49 failed with stages
......@@ -35,7 +35,7 @@
<script>
switchAudioState = function (clapsPerSecond) {
if (clapsPerSecond < 4) {
level = 0;
} else if (clapsPerSecond >= 4) {
......@@ -50,13 +50,13 @@
level = 5;
};
if (level = 0) {
if (level == 0) {
if( claps.playing() ){
claps.fade(1, 0, 1000);
}
};
console.log(level);
console.log(clapsPerSecond, level);
};
document.addEventListener("DOMContentLoaded", function() {
......
......@@ -9,7 +9,9 @@ import gevent
from geventwebsocket import WebSocketError
from geventwebsocket.handler import WebSocketHandler
import werkzeug.serving
from werkzeug.serving import run_simple
bottle.debug(True) # Always reload template, do not cache
app = bottle.Bottle()
claps = 0
......@@ -60,10 +62,10 @@ def handle_websocket():
def index():
return bottle.template('index.tpl')
@werkzeug.serving.run_with_reloader
def runServer():
app.debug = True
ws = gevent.pywsgi.WSGIServer(("0.0.0.0", 8080), app,
handler_class=WebSocketHandler)
handler_class=WebSocketHandler)
ws.serve_forever()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment