import pyuwsgi

from load.projects.firestarter.src.config import WSGI_PROC_NUM, ENV_TYPE


def main():
    port = '5000' if ENV_TYPE == 'local' else '80'

    pyuwsgi.run([
        '--http', '[::]:{}'.format(port),
        '--module', 'load.projects.firestarter.src.main:create_app()',
        '--log-master',
        '--processes', '{num}'.format(num=WSGI_PROC_NUM),
        '--enable-threads'
    ])
