# This WebSocket provides an OpenApi to the recommender engine.

# Given a product returns a list of recommendations based on product similarity.

from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
import pymongo

class SimpleEcho(WebSocket):

    def handleMessage(self):
        # echo message back to client
        self.sendMessage(self.data)

    def handleConnected(self):
        print self.address, 'connected'

    def handleClose(self):
        print self.address, 'closed'

server = SimpleWebSocketServer('', 8000, SimpleEcho)
server.serveforever()
