Spaces:
Sleeping
Sleeping
Download start_server.py from dharu007/ArtifaXChatBot: direct link, hf CLI and curl.
- Browser
- Download file 1.11 kB
-
https://huggingface.co/spaces/dharu007/ArtifaXChatBot/resolve/main/start_server.py
- Command line
-
hf download hf://spaces/dharu007/ArtifaXChatBot/start_server.py
-
curl -L -o start_server.py https://huggingface.co/spaces/dharu007/ArtifaXChatBot/resolve/main/start_server.py
1.11 kB
| #!/usr/bin/env python3 | |
| """ | |
| ArtifaX Production Server - Simple Startup | |
| Run this to start the Flask app on port 8080 | |
| """ | |
| import os | |
| import sys | |
| # Change to app directory | |
| app_dir = os.path.dirname(os.path.abspath(__file__)) | |
| os.chdir(app_dir) | |
| print("\n" + "="*70) | |
| print("🚀 ArtifaX Production Server") | |
| print("="*70) | |
| from web_server import app, socketio | |
| port = 8080 | |
| host = '0.0.0.0' | |
| print(f"\n✅ Server Configuration:") | |
| print(f" Port: {port}") | |
| print(f" Host: {host}") | |
| print(f"\n📍 Access URLs:") | |
| print(f" Local: http://localhost:{port}") | |
| print(f" Network: http://192.168.1.17:{port}") | |
| print(f"\n🌐 For external access (remote colleagues):") | |
| print(f" Start ngrok manually: ngrok http 8080") | |
| print(f"\n🎯 Starting server...\n") | |
| try: | |
| socketio.run( | |
| app, | |
| host=host, | |
| port=port, | |
| debug=False, | |
| use_reloader=False, | |
| allow_unsafe_werkzeug=True | |
| ) | |
| except KeyboardInterrupt: | |
| print("\n\n✅ Server stopped") | |
| sys.exit(0) | |
| except Exception as e: | |
| print(f"\n❌ Error: {e}") | |
| sys.exit(1) | |