File size: 1,039 Bytes
17d9fad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
32
33
34
35
36
37
38
39
40
41
42
43
"""Hello-world FastAPI for SecureAgentRAG HF Space smoke test.

Verifies:
- HF Docker SDK builds a custom image
- Free CPU Basic (2 vCPU / 16 GB) accepts our deps
- Port 7860 reachable from public internet (Egypt origin)

This is a smoke test only. Real backend lands in Phase 2 (see
launch-plan/03-backend-byok.md).
"""

from __future__ import annotations

import os
import time

from fastapi import FastAPI

app = FastAPI(title="SecureAgentRAG API — smoke", version="0.0.1-smoke")

_BOOT_TIME = time.monotonic()


@app.get("/")
def root() -> dict[str, object]:
    return {
        "service": "secureagentrag-api",
        "phase": "1-smoke",
        "ok": True,
        "uptime_seconds": round(time.monotonic() - _BOOT_TIME, 2),
    }


@app.get("/health")
def health() -> dict[str, object]:
    return {
        "status": "ok",
        "service": "secureagentrag-api",
        "phase": "1-smoke",
        "python": os.environ.get("PYTHON_VERSION", "unknown"),
        "uptime_seconds": round(time.monotonic() - _BOOT_TIME, 2),
    }