MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / main

Function main

app/deploy/jockey/api/run.py:8–35  ·  view source on GitHub ↗

Run the API server.

()

Source from the content-addressed store, hash-verified

6
7
8def main():
9 """Run the API server."""
10 try:
11 from jockey.api.main import app
12
13 host = os.getenv("API_HOST", "0.0.0.0")
14 port = int(os.getenv("API_PORT", "8000"))
15 reload = os.getenv("API_RELOAD", "true").lower() == "true"
16
17 print(f"Starting Jockey Deployment API on {host}:{port}")
18 print(f"Redis host: {os.getenv('DEPLOY_REDIS_HOST', 'localhost')}")
19 print(f"Redis port: {os.getenv('DEPLOY_REDIS_PORT', '6379')}")
20
21 if reload:
22 # Use import string for reload mode
23 uvicorn.run("jockey.api.main:app", host=host, port=port, reload=reload)
24 else:
25 uvicorn.run(app, host=host, port=port, reload=reload)
26
27 except ImportError as e:
28 print(f"Import error: {e}")
29 print("Make sure you're running this from the correct directory")
30 return 1
31 except Exception as e:
32 print(f"Error starting API: {e}")
33 return 1
34
35 return 0
36
37
38if __name__ == "__main__":

Callers 1

run.pyFile · 0.70

Calls 1

runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…