-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroot.py
More file actions
46 lines (43 loc) · 1.2 KB
/
Copy pathroot.py
File metadata and controls
46 lines (43 loc) · 1.2 KB
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
44
45
46
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": "Python",
"severity": "success",
"version": __version__,
"base_url": base_url,
"time": epoch,
}
endpoints = [
{"name": "health", "url": f"{base_url}/health"},
{
"name": "Prompt°",
"endpoints": [
{"name": "list", "url": f"{base_url}/prompt"},
{"name": "linkedin", "url": f"{base_url}/prompt/linkedin"},
]
},
{
"name": "Orders°",
"endpoints": [
{"name": "list", "url": f"{base_url}/orders"},
]
},
{
"name": "Prospects°",
"endpoints": [
{"name": "list", "url": f"{base_url}/prospects"},
]
},
{"name": "Docs", "url": f"{base_url}/docs"},
]
return {"meta": meta, "data": endpoints}