main.py 479 Bytes
Newer Older
1
from import_api_app import create_app
Matthias's avatar
Matthias committed
2
3
4
import logging
import os

5
if __name__ == "__main__":
Matthias's avatar
Matthias committed
6
7
8
9
10
    numeric_level = getattr(logging, os.getenv('LOG_LEVEL').upper(), None)
    if not isinstance(numeric_level, int):
        raise ValueError(f'Invalid log level: {os.getenv("LOG_LEVEL")}')
    logging.basicConfig(format='%(levelname)-8s [%(filename)s:%(lineno)d] %(message)s',
                        level=numeric_level)
11
    app = create_app()
Matthias's avatar
Matthias committed
12
    app.run(host='0.0.0.0', debug=False)