Add position update on map based on event store
This commit is contained in:
@@ -27,6 +27,21 @@ def get_cars_events():
|
||||
return json_util.dumps({'cursor': cars})
|
||||
|
||||
|
||||
@app.route('/api/v1/resources/traffic_light_events', methods=['GET'])
|
||||
def get_traffic_light_events():
|
||||
id = request.args.get('id')
|
||||
|
||||
try:
|
||||
response = requests.get(EVENT_STORE_URL + 'TL:' + id + '/0/')
|
||||
traffic_lights = json.loads(response.text)
|
||||
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
print("Is the EVENT_STORE_URL running and reachable?")
|
||||
raise e
|
||||
|
||||
return json_util.dumps({'cursor': traffic_lights})
|
||||
|
||||
|
||||
@app.route('/api/v1/resources/cars', methods=['GET'])
|
||||
def get_cars():
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user