aboutsummaryrefslogtreecommitdiff
path: root/demo/__init__.py
blob: 86af046cca754b8172c98833ed636cf1b82d063e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
""" A small flask Hello World """

import os
import subprocess

from flask import Flask, jsonify

APP = Flask(__name__)

# Load file based configuration overrides if present
if os.path.exists(os.path.join(os.getcwd(), 'config.py')):
    APP.config.from_pyfile(os.path.join(os.getcwd(), 'config.py'))
else:
    APP.config.from_pyfile(os.path.join(os.getcwd(), 'config.env.py'))

APP.secret_key = APP.config['SECRET_KEY']

@APP.route('/')
def _index():
    return jsonify(status=200, response="OK")