import os
import signal
from flask import Flask
import sys

#sys.path.append('/home/msmith/Development/cicd-buzz/buzz')
#sys.path.append('/home/travis/build/gritandmettle/cicd-buzz/buzz')
#import generator

from buzz import generator

app = Flask(__name__)

signal.signal(signal.SIGINT, lambda s, f: os._exit(0))

@app.route("/")
def generate_buzz():
    page = '<html><body><h1>'
    page += generator.generate_buzz()
    page += '</h1></body></html>'
    return page

if __name__ == "__main__":
    app.run(host='0.0.0.0', port=int(os.getenv('PORT', 5000)))
