File size: 908 Bytes
facf506
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
35
36
37
38
39
#!/usr/bin/env python3
"""
Data2Model Run Script
Easy way to start the application
"""

import os
import sys

def main():
    print("=" * 60)
    print("       🚀 Starting Data2Model Server")
    print("=" * 60)
    print()
    print("Server will start at: http://localhost:5000")
    print("Press Ctrl+C to stop the server")
    print()
    print("=" * 60)
    print()
    
    # Set environment variables
    os.environ['FLASK_APP'] = 'app.py'
    os.environ['FLASK_ENV'] = 'development'
    
    # Import and run the app
    try:
        from app import app
        app.run(debug=True, host='0.0.0.0', port=5000)
    except ImportError:
        print("❌ Error: Could not import app.py")
        print("   Make sure you're in the Data2Model directory")
        sys.exit(1)
    except KeyboardInterrupt:
        print("\n\n✅ Server stopped")
        sys.exit(0)

if __name__ == "__main__":
    main()