-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_server.py
More file actions
37 lines (31 loc) · 988 Bytes
/
Copy pathstart_server.py
File metadata and controls
37 lines (31 loc) · 988 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
35
36
37
#!/usr/bin/env python3
"""
Simple script to start the Flask server with proper environment setup
"""
import os
import sys
# Check if GROQ_API_KEY is set in environment
if 'GROQ_API_KEY' not in os.environ:
print("Error: GROQ_API_KEY environment variable not set")
print("Please set it in your .env file or environment variables")
sys.exit(1)
print("Environment variables set:")
print(f"GROQ_API_KEY: {os.environ.get('GROQ_API_KEY', 'NOT SET')}")
try:
print("Importing Flask app...")
from app import app
print("Flask app imported successfully!")
print("Starting Flask server on http://127.0.0.1:5000")
print("Press Ctrl+C to stop the server")
# Start the server
app.run(
debug=True,
host='127.0.0.1',
port=5000,
use_reloader=False # Disable reloader to avoid issues
)
except Exception as e:
print(f"Error starting server: {e}")
import traceback
traceback.print_exc()
sys.exit(1)