from geventwebsocket.handler import WebSocketHandler                             
from gevent.pywsgi import WSGIServer                                             
from flask import Flask, request, render_template                                                 
                                                                                 
app = Flask(__name__)                                                            

@app.route('/')                                          
def index():                                                                      
    return render_template('index.html')                                
                                                                                 
@app.route('/api')                                                               
def api():                                                                       
    if request.environ.get('wsgi.websocket'):                                                                                                        
        ws = request.environ['wsgi.websocket']                                   
        while True:                                                              
            message = ws.wait()                                                  
            ws.send(message)                                                     
    return                                                                       
                                                                                 
if __name__ == '__main__':                                                       
    http_server = WSGIServer(('',5000), app, handler_class=WebSocketHandler)     
    http_server.serve_forever()
@@ -49,37 +49,8 @@
 dler
-                             
 %0Afro
@@ -86,53 +86,8 @@
 rver
-                                             
 %0Afro
@@ -136,1406 +136,346 @@
 late
-                                                 %0A                                                                                 %0Aapp = Flask(__name__)                                                            %0A%0A@app.route('/')                                          %0Adef index():                                                                      %0A    return render_template('index.html')                                %0A                                                                                 %0A@app.route('/api')                                                               %0Adef api():                                                                       %0A    if request.environ.get('wsgi.websocket'):                                                                                                        %0A        ws = request.environ%5B'wsgi.websocket'%5D                                   %0A        while True:                                                              %0A            message = ws.wait()                                                  %0A            ws.send(message)                                                     %0A    return                                                                       %0A                                                                                 %0Aif __name__ == '__main__':                                                       
+%0A%0Aapp = Flask(__name__)%0A%0A@app.route('/')%0Adef index():%0A    return render_template('index.html')%0A%0A@app.route('/api')%0Adef api():%0A    if request.environ.get('wsgi.websocket'):%0A        ws = request.environ%5B'wsgi.websocket'%5D%0A        while True:%0A            message = ws.wait()%0A            ws.send(message)%0A    return%0A%0Aif __name__ == '__main__':
 %0A   
@@ -547,21 +547,16 @@
 Handler)
-     
 %0A    htt
@@ -579,8 +579,9 @@
 orever()
+%0A

remove whitespace