#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time
import subprocess
from flask import Response
from flask import Flask, Response
from api import api_blueprint as api
from api import web_blueprint as web

app = Flask(__name__)
app.register_blueprint(api, url_prefix='/api')
app.register_blueprint(web, url_prefix='/web')

app.template_folder = "./web/templates"
app.static_folder = "./web/static"

if __name__ == "__main__":
    import sys
    import socket

    try:
        port = sys.argv[1]
    except IndexError:
        port = 5533

    hostname = socket.getfqdn()
    app.run(host=hostname, port=port, threaded=True, debug=True)
