add an endpoint to get the airport information
This commit is contained in:
		
							
								
								
									
										10
									
								
								app.py
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								app.py
									
									
									
									
									
								
							| @@ -29,6 +29,16 @@ app = Flask('AMAN') | ||||
| if __name__ == '__main__': | ||||
|     app.run() | ||||
|  | ||||
| @app.route('/aman/airports') | ||||
| def airports(): | ||||
|     retval = [] | ||||
|  | ||||
|     for airport in aman.Workers: | ||||
|         retval.append(airport.Icao) | ||||
|  | ||||
|     data = json.dumps(retval, ensure_ascii=True) | ||||
|     return Response(data, status=200, mimetype='application/json') | ||||
|  | ||||
| @app.route('/aman/configuration/<icao>') | ||||
| def configuration(icao): | ||||
|     airport = aman.findAirport(icao.upper()) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user