From ee0b4d7f9896f385f52bb604fcc675505be284b5 Mon Sep 17 00:00:00 2001 From: Matheus Mota Date: Sun, 14 Jul 2019 15:49:08 -0300 Subject: [PATCH] Update server.py --- src/server.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/server.py b/src/server.py index 5bc01fb..6454f80 100644 --- a/src/server.py +++ b/src/server.py @@ -49,15 +49,10 @@ def post(self): @cross_origin(origin='*') def get(self): - docs = self.mongodb_collection.find().sort([("timestamp", pymongo.DESCENDING)]) + message = {"message": "message streaming is up" - items = [] - - for doc in docs: - doc['_id'] = str(doc['_id']) - items.append(doc) - - return jsonify({'execution_stream':items}) + } + return message @cross_origin(origin='*') @@ -76,8 +71,8 @@ def delete(self): api = Api(web_app) mongodb_client = pymongo.MongoClient("mongodb://{0}:{1}/" - .format(web_app.config['HARENA_LOGGER_MONGODB_HOST'], \ - web_app.config['HARENA_LOGGER_MONGODB_PORT'])) + .format(web_app.config['HARENA_LOGGER_MONGODB_HOST'], \ + web_app.config['HARENA_LOGGER_MONGODB_PORT'])) mongodb_db = mongodb_client[web_app.config['HARENA_LOGGER_MONGODB_DB']] mongodb_collection = mongodb_db[web_app.config['HARENA_LOGGER_MONGODB_COLLECTION']]