forked from datapunkz/python-cicd-workshop
-
Notifications
You must be signed in to change notification settings - Fork 115
Expand file tree
/
Copy pathhello_world.py
More file actions
29 lines (23 loc) · 708 Bytes
/
hello_world.py
File metadata and controls
29 lines (23 loc) · 708 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
from flask import Flask
app = Flask(__name__)
def generate_html(message):
html = """
<html>
<body>
<div style='text-align:center;font-size:80px;'>
<image height="340" width="1200" src="https://user-images.githubusercontent.com/194400/41597205-a57442ea-73c4-11e8-9591-61f5c83c7e66.png">
<br>
{0}<br>
</div>
</body>
</html>""".format(message)
return html
def greet():
greeting = 'Welcome to CI/CD 101 using CircleCI!'
return greeting
@app.route('/')
def hello_world():
html = generate_html(greet())
return html
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)