-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev_server.py
More file actions
executable file
·59 lines (53 loc) · 1.61 KB
/
Copy pathdev_server.py
File metadata and controls
executable file
·59 lines (53 loc) · 1.61 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python3
"""
Development server script for DungeonMindServer.
This script sets the environment to development and enables hot reloading.
"""
import os
import sys
import uvicorn
from pathlib import Path
# Set environment to development
os.environ['ENVIRONMENT'] = 'development'
# Add the current directory to Python path
sys.path.insert(0, str(Path(__file__).parent))
def main():
"""Main function for running the development server."""
print("🚀 Starting DungeonMindServer in development mode with hot reload...")
print("📁 Watching directories for changes:")
print(" - routers/")
print(" - cardgenerator/")
print(" - cloudflare/")
print(" - cloudflareR2/")
print(" - firestore/")
print(" - ruleslawyer/")
print(" - storegenerator/")
print(" - sms/")
print(" - mapgenerator/")
print("")
print("🌐 Server will be available at: http://localhost:7860")
print("📊 Health check: http://localhost:7860/health")
print("")
print("Press Ctrl+C to stop the server")
print("=" * 50)
# Use uvicorn.run with import string for proper reload functionality
uvicorn.run(
"app:app", # Import string format required for reload
host="0.0.0.0",
port=7860,
reload=True,
reload_dirs=[
"routers",
"cardgenerator",
"cloudflare",
"cloudflareR2",
"firestore",
"ruleslawyer",
"storegenerator",
"sms",
"mapgenerator"
],
log_level="info"
)
if __name__ == "__main__":
main()