Add crossway api for traffic_lights
This commit is contained in:
@@ -28,10 +28,18 @@ def get_cars():
|
||||
return json_util.dumps({'cursor': cars})
|
||||
|
||||
|
||||
@app.route('/api/v1/resources/traffic_lights', methods=['GET'])
|
||||
def get_traffic_lights():
|
||||
|
||||
@app.route('/api2')
|
||||
def api2():
|
||||
return 'api2'
|
||||
try:
|
||||
response = requests.get(ENTITY_IDENT_URL + 'traffic_lights')
|
||||
traffic_lights = response.json()['cursor']
|
||||
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
print("Is the entity_ident_server running and reachable?")
|
||||
raise e
|
||||
|
||||
return json_util.dumps({'cursor': traffic_lights})
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user