Skip to content

Commit 18a7119

Browse files
committed
fix(deploy): bind to IPv6 and add root endpoint for Railway
1 parent f8d4ade commit 18a7119

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/docchat/api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ class ErrorResponse(BaseModel):
164164
# ── Endpoints ─────────────────────────────────────────────────────────────────
165165

166166

167+
@app.get("/", include_in_schema=False)
168+
async def root():
169+
from fastapi.responses import RedirectResponse
170+
return RedirectResponse(url="/docs")
171+
172+
167173
@app.get("/health", response_model=HealthResponse)
168174
async def health():
169175
store = _get_store()

src/docchat/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
def main() -> None:
77
import uvicorn
88

9-
host = os.environ.get("DOCCHAT_HOST", "0.0.0.0")
9+
host = os.environ.get("DOCCHAT_HOST", "::")
1010
# Railway (và các Cloud PaaS khác) tự động cấp phát cổng qua biến PORT
1111
port_str = os.environ.get("PORT") or os.environ.get("DOCCHAT_PORT", "8000")
1212
port = int(port_str)

0 commit comments

Comments
 (0)