To_DO: ERROR AFTER LOGGING IN
This commit is contained in:
30
main.py
30
main.py
@@ -1,12 +1,28 @@
|
||||
import sqlLite
|
||||
|
||||
import logging
|
||||
import os
|
||||
from frontend.app import app
|
||||
|
||||
sqlLite.set_db_name("databases/test.db")
|
||||
# Logging konfigurieren
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
||||
)
|
||||
|
||||
import sqlLite.create as create
|
||||
|
||||
create.create_table_t_user()
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True, host='0.0.0.0', port=8080)
|
||||
# Environment-Konfiguration
|
||||
debug = os.getenv('FLASK_DEBUG', 'False').lower() == 'true'
|
||||
host = os.getenv('FLASK_HOST', '0.0.0.0')
|
||||
port = int(os.getenv('FLASK_PORT', '8080'))
|
||||
|
||||
logger.info(f"Starting ChatBot application on {host}:{port}")
|
||||
logger.info(f"Debug mode: {debug}")
|
||||
|
||||
try:
|
||||
app.run(debug=debug, host=host, port=port)
|
||||
except KeyboardInterrupt:
|
||||
logger.info("Application stopped by user")
|
||||
except Exception as e:
|
||||
logger.error(f"Application failed to start: {e}")
|
||||
raise
|
||||
Reference in New Issue
Block a user