Skip to content

Commit

Permalink
Update server.py
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusmota authored Jul 14, 2019
1 parent a895901 commit ee0b4d7
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='*')
Expand All @@ -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']]
Expand Down

0 comments on commit ee0b4d7

Please sign in to comment.