-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathrun.py
More file actions
23 lines (15 loc) · 775 Bytes
/
Copy pathrun.py
File metadata and controls
23 lines (15 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from app import create_app
from app.utils.logger import logger # Import the logger
from app.config import Config # Import Config class
if __name__ == '__main__':
try:
logger.info("Hello from the Sentiment Analysis Back End Server :D")
# Create the Config instance (Singleton will ensure it's only loaded once)
config = Config(config_path='config.yaml')
# Create Flask APP
flask_app_config = config.config.get('flask')
app = create_app(flask_app_config)
# Run the APP
app.run(host=flask_app_config['host'], port=flask_app_config['port'], debug=flask_app_config['debug'])
except Exception as e:
logger.error(f"Unexpected Error in the Back End Server: {e}")