doosaganesh commited on
Commit
fbd855c
·
verified ·
1 Parent(s): a80a354

Upload 8 files

Browse files
Files changed (3) hide show
  1. server/__init__.py +2 -0
  2. server/app.py +10 -1
  3. server/requirements.txt +2 -1
server/__init__.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ # Makes server/ a proper Python package so `server.app:app` can be imported
2
+ # from the repo root by openenv validate and the openenv-core toolchain.
server/app.py CHANGED
@@ -9,6 +9,15 @@ Endpoints:
9
  GET /tasks — list available tasks
10
  """
11
 
 
 
 
 
 
 
 
 
 
12
  from fastapi import FastAPI, HTTPException
13
  from fastapi.middleware.cors import CORSMiddleware
14
 
@@ -45,7 +54,7 @@ env = GitConflictEnv()
45
  @app.get("/health")
46
  def health():
47
  """Liveness check — must return 200 for HF Space validation."""
48
- return {"status": "ok", "env": "git-conflict-resolver"}
49
 
50
 
51
  @app.get("/tasks")
 
9
  GET /tasks — list available tasks
10
  """
11
 
12
+ import sys
13
+ from pathlib import Path
14
+
15
+ # Ensure server/ directory is in sys.path so modules can be imported
16
+ # whether running from repo root (openenv validate) or inside Docker (/app)
17
+ _SERVER_DIR = Path(__file__).resolve().parent
18
+ if str(_SERVER_DIR) not in sys.path:
19
+ sys.path.insert(0, str(_SERVER_DIR))
20
+
21
  from fastapi import FastAPI, HTTPException
22
  from fastapi.middleware.cors import CORSMiddleware
23
 
 
54
  @app.get("/health")
55
  def health():
56
  """Liveness check — must return 200 for HF Space validation."""
57
+ return {"status": "healthy", "service": "git-conflict-resolver"}
58
 
59
 
60
  @app.get("/tasks")
server/requirements.txt CHANGED
@@ -2,4 +2,5 @@ fastapi==0.111.0
2
  uvicorn[standard]==0.29.0
3
  pydantic==2.7.1
4
  openai>=1.0.0
5
- python-dotenv
 
 
2
  uvicorn[standard]==0.29.0
3
  pydantic==2.7.1
4
  openai>=1.0.0
5
+ python-dotenv
6
+ openenv-core>=0.2.0