-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroot.py
More file actions
29 lines (27 loc) · 845 Bytes
/
Copy pathroot.py
File metadata and controls
29 lines (27 loc) · 845 Bytes
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
from app import __version__
from fastapi import APIRouter
import os, time
from dotenv import load_dotenv
from app import __version__
router = APIRouter()
@router.get("/")
def root() -> dict:
"""NX-AI."""
load_dotenv()
base_url = os.getenv("BASE_URL", "http://localhost:8000")
epoch = int(time.time() * 1000)
meta = {
"title": "NX-AI",
"severity": "success",
"version": __version__,
"base_url": base_url,
"time": epoch,
}
endpoints = [
{"name": "docs", "url": f"{base_url}/docs"},
{"name": "resend", "url": f"{base_url}/resend"},
{"name": "health", "url": f"{base_url}/health"},
{"name": "prompts", "url": f"{base_url}/prompts"},
{"name": "prospects", "url": f"{base_url}/prospects"},
]
return {"meta": meta, "data": endpoints}