Skip to content

Commit

Permalink
cors
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusmota committed May 12, 2019
1 parent 0ad3e3d commit dded37f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, broker, mongodb_collection):
self.broker = broker
self.mongodb_collection = mongodb_collection

@cross_origin()
@cross_origin(origin='*')
def post(self):
message = request.get_json()
print(json.dumps(message))
Expand All @@ -47,7 +47,7 @@ def post(self):
return jsonify(data)


@cross_origin()
@cross_origin(origin='*')
def get(self):
docs = self.mongodb_collection.find().sort([("timestamp", pymongo.DESCENDING)])

Expand All @@ -60,7 +60,7 @@ def get(self):
return jsonify({'execution_stream':items})


@cross_origin()
@cross_origin(origin='*')
def delete(self):
self.mongodb_collection.delete_many({})
data = {"message":'Messages in the execution stream deleted successfully'}
Expand Down

0 comments on commit dded37f

Please sign in to comment.