add an endpoint to get the airport information

이 커밋은 다음에 포함됨:
Sven Czarnian가 2021-11-18 08:47:09 +01:00를 커밋했습니다
1 부모 23d00899fc
커밋 d2b326fa9c
1 파일이 변경됨
+10
+10
파일 보기
@@ -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())