khushiii02 commited on
Commit
2267c20
·
verified ·
1 Parent(s): 4a100cc

Update server/app.py

Browse files
Files changed (1) hide show
  1. server/app.py +8 -6
server/app.py CHANGED
@@ -1,9 +1,11 @@
1
  """
2
  server/app.py — Support Ticket Agent OpenEnv Server
3
 
4
- This is the required entry point for `openenv validate`.
5
- It re-exports the FastAPI app from the root main.py and provides
6
- the `start` function used by [project.scripts] server = "server.app:start".
 
 
7
  """
8
  from __future__ import annotations
9
 
@@ -16,10 +18,10 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
16
  # Re-export the FastAPI app from root main.py
17
  from main import app # noqa: F401
18
 
19
- __all__ = ["app", "start"]
20
 
21
 
22
- def start() -> None:
23
  """Entry point called by `uv run server` and [project.scripts]."""
24
  import uvicorn
25
  uvicorn.run(
@@ -32,4 +34,4 @@ def start() -> None:
32
 
33
 
34
  if __name__ == "__main__":
35
- start()
 
1
  """
2
  server/app.py — Support Ticket Agent OpenEnv Server
3
 
4
+ Required entry point for `openenv validate`.
5
+ Rules:
6
+ - Function must be named `main` (not start)
7
+ - Must have if __name__ == '__main__': block
8
+ - pyproject.toml must have: server = "server.app:main"
9
  """
10
  from __future__ import annotations
11
 
 
18
  # Re-export the FastAPI app from root main.py
19
  from main import app # noqa: F401
20
 
21
+ __all__ = ["app", "main"]
22
 
23
 
24
+ def main() -> None:
25
  """Entry point called by `uv run server` and [project.scripts]."""
26
  import uvicorn
27
  uvicorn.run(
 
34
 
35
 
36
  if __name__ == "__main__":
37
+ main()