forked from Alishahryar1/free-claude-code
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.py
More file actions
30 lines (24 loc) · 850 Bytes
/
server.py
File metadata and controls
30 lines (24 loc) · 850 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
"""
Claude Code Proxy - Entry Point
Minimal entry point that imports the app from the api module.
Run with: uv run uvicorn server:app --host 0.0.0.0 --port 8082 --timeout-graceful-shutdown 5
"""
from api.app import app, create_app
__all__ = ["app", "create_app"]
if __name__ == "__main__":
import uvicorn
from cli.process_registry import kill_all_best_effort
from config.settings import get_settings
settings = get_settings()
try:
# timeout_graceful_shutdown ensures uvicorn doesn't hang on task cleanup.
uvicorn.run(
app,
host=settings.host,
port=settings.port,
log_level="debug",
timeout_graceful_shutdown=5,
)
finally:
# Safety net: cleanup subprocesses if lifespan shutdown doesn't fully run.
kill_all_best_effort()