Browse Source

maj apikaz

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

15
dockers/apikaz/source/app.py

@ -8,11 +8,20 @@ def welcome():
# return a json
return jsonify({'status': 'api working'})
@app.route('/hello')
def hello():
return 'Hello, World'
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'}
)

Loading…
Cancel
Save