Skip to content

Commit

Permalink
readded app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
drewtu2 committed Apr 23, 2017
1 parent 8ebfa05 commit 3b4c5c6
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
from gevent import monkey
monkey.patch_all()
from flask import Flask
from flask import render_template
from flask import request
from flask_socketio import SocketIO, emit
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
socketio = SocketIO(app)

@app.route('/')
def index():
return render_template("index.html")

@app.route('/images/<filename>/')
def getImg(filename):
return app.send_static_file('images/' + filename)

@app.route('/dashboard/', methods=['GET'])
def dashboard():
if "command" in request.args:
command = request.args['command']
sendCommand(command)
return render_template('dashboard.html')

@socketio.on('channel-a')
def sendCommand(message):
socketio.emit("channel-a", message)

if __name__ == '__main__':
app.debug = True
socketio.run(app, port=5000)
from gevent import monkey
monkey.patch_all()
from flask import Flask
from flask import render_template
from flask import request
from flask_socketio import SocketIO, emit
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
socketio = SocketIO(app)

@app.route('/')
def index():
return render_template("index.html")

@app.route('/images/<filename>/')
def getImg(filename):
return app.send_static_file('images/' + filename)

@app.route('/dashboard/', methods=['GET'])
def dashboard():
if "command" in request.args:
command = request.args['command']
sendCommand(command)
return render_template('dashboard.html')

@socketio.on('channel-a')
def sendCommand(message):
socketio.emit("channel-a", message)

if __name__ == '__main__':
app.debug = True
socketio.run(app, port=5000)

0 comments on commit 3b4c5c6

Please sign in to comment.