aswi2021jmsd-gitlab/app.py @ 6b5b8579
1 |
from flask import Flask |
---|---|
2 |
import os |
3 |
|
4 |
app = Flask(__name__) |
5 |
|
6 |
|
7 |
@app.route('/') |
8 |
def index(): |
9 |
return 'Welcome to the X.509 management application homepage!' |
10 |
|
11 |
|
12 |
if __name__ == '__main__': |
13 |
host = "0.0.0.0" |
14 |
port = 5000 |
15 |
|
16 |
# TODO better load this from config.py
|
17 |
if "FLASK_HOST" in os.environ: |
18 |
host = os.environ["FLASK_HOST"] |
19 |
|
20 |
if "FLASK_PORT" in os.environ: |
21 |
host = os.environ["FLASK_PORT"] |
22 |
|
23 |
app.run(host=host, port=port) |
24 |
|