-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathapp.py
More file actions
36 lines (26 loc) · 783 Bytes
/
app.py
File metadata and controls
36 lines (26 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""
Simple Flask App
"""
import os
from flask import Flask
PORT = int(os.getenv('PORT', '8080'))
app = Flask(__name__)
@app.route('/', methods=['GET'])
def index():
"""Home Page"""
app.logger.info("Request for home page...")
return {"name": "Flask App"}, 200
@app.route('/health', methods=['GET'])
def health():
"""Health Check"""
return {"status": "OK"}, 200
@app.route('/hello', methods=['GET'])
def hello():
"""Send back Hello world"""
app.logger.info("Request for Hello message...")
return {"message": "Hello World"}, 200
############################################################
# M A I N P R O G R A M
############################################################
if __name__ == '__main__':
app.run(host='0.0.0.0', port=PORT)