Browse Source

maj apikaz

master
fabrice.regnier 2 weeks ago
parent
commit
1ddd5b7743
  1. 14
      dockers/apikaz/source/app.py

14
dockers/apikaz/source/app.py

@ -8,20 +8,20 @@ def welcome():
# return a json
return jsonify({'status': 'api working'})
if __name__ == '__main__':
#define the localhost ip and the port that is going to be used
# in some future article, we are going to use an env variable instead a hardcoded port
app.run(host='0.0.0.0', port=os.getenv('PORT'))
@app.route('/hello')
def hello():
return 'Hello, World'
@app.route('/liste_orgas_paheko')
def get_list_orgas_paheko():
return jsonify(
{'nom court': 'toto'},
{'nom court': 'titi'}
)
/*************************************************/
if __name__ == '__main__':
#define the localhost ip and the port that is going to be used
# in some future article, we are going to use an env variable instead a hardcoded port
app.run(host='0.0.0.0', port=os.getenv('PORT'))

Loading…
Cancel
Save