File size: 921 Bytes
d66ab65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python3
"""

Tokenizer Pro - Advanced tokenization analysis and visualization



This is the main entry point for the Flask application.

"""

import os
from app import create_app
from config import Config, DevelopmentConfig, ProductionConfig

def get_config_class():
    """Determine which configuration class to use based on environment."""
    env = os.getenv('FLASK_ENV', 'development').lower()
    
    if env == 'production':
        return ProductionConfig
    elif env == 'development':
        return DevelopmentConfig
    else:
        return Config

app = create_app(get_config_class())

if __name__ == "__main__":
    # Get configuration from environment variables
    host = os.getenv('HOST', '0.0.0.0')
    port = int(os.getenv('PORT', 7860))
    debug = os.getenv('DEBUG', 'False').lower() in ('true', '1', 'yes')
    
    app.run(host=host, port=port, debug=debug)