How do I send a message to client after a post request is made? I store the data from the post request into a database and I want to notify the client that the database has been changed. Is there way to combine the restapi with websocket? the examples I am finding are using websockets to recieve data and send to client while I am using post method receive and want to use websocket to alert. any help would be appreciated. 

server.py

```
import sqlite3
from flask import Flask, render_template
from flask_socketio import SocketIO

app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
socketio = SocketIO(app)

@app.route('/', methods=['GET'])
def index():
    render_template('index.html')

# listen for data
@app.route('/listen/<data>',methods=['POST'])
def listen(data):
    # insert to db
    conn = sqlite3.connect('storage.db')
    c = conn.cursor()
    c.execute('''CREATE TABLE info(num text)''')
    c.execute('''INSERT INTO info(num) VALUES(?)''',(data))
    conn.commit()
    conn.close()

    #send alert to client

@socketio.on('message')
def handle_message(message):
    send(message)

if __name__ == '__main__':
    socketio.run(app)

```

index.html

```
<head>
<script type="text/javascript"src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.6/socket.io.min.js"></script>
<script type="text/javascript" charset="utf-8">
        var socket = io.connect('http://' + document.domain + ':' + location.port);
        socket.on('message', function(data) {
             console.log(data);
        });
  </script>
</head>

```