from flask import Flask, jsonify from mongodb import connector as mongo_connector app = Flask(__name__) mongo_connector.connect() @app.route('/health-check') def health_check(): return jsonify({"message": "I'm alive."})
def create(self, init_player): return connector.connect().PlayerIo.factory(init_player)
def read(self, filter=None): if not filter: return connector.connect().PlayerIo.find() this = filter.where() return connector.connect().PlayerIo.find(this)
def factory(init_player): p = connector.connect().PlayerIo() for key, value in init_player.iteritems(): p[key] = value p.save() return p