-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
34 lines (25 loc) · 975 Bytes
/
run.py
File metadata and controls
34 lines (25 loc) · 975 Bytes
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
32
33
34
#!/usr/bin/env python3
"""
RansomwareDetector - Main entry point for the Flask backend server.
"""
import sys
import os
from backend.utils import performance_tracker
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from backend import create_app, LogManager
from backend.core.configuration_manager import ConfigurationManager
# Uncomment to enable performance tracking
#performance_tracker.PERFORMANCE_TRACKING_ENABLED = True
# Get connection parameters from configuration (with environment variable fallback)
config = ConfigurationManager()
BACKEND_HOST = config.get_backend_host()
BACKEND_PORT = config.get_backend_port()
app, socketio = create_app()
def main():
LogManager.get().info(
f"Launching Flask server at {BACKEND_HOST}:{BACKEND_PORT} ...",
source="SYSTEM"
)
socketio.run(app, host=BACKEND_HOST, port=BACKEND_PORT, debug=True, use_reloader=False, allow_unsafe_werkzeug=True)
if __name__ == "__main__":
main()