Skip to content

Commit 24f09a8

Browse files
committed
Add docs endpoint; remove psycopg2 import
Remove unused psycopg2 import, add a /docs entry to the root endpoints list, and include base_url in the response meta (removing the duplicated base_url key). Small cleanup to tidy imports and expose the documentation URL from the API root.
1 parent d834b8e commit 24f09a8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/api/root.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from app import __version__
22
from fastapi import APIRouter
33
import os, time
4-
import psycopg2
54
from dotenv import load_dotenv
65
from app import __version__
76

@@ -14,14 +13,15 @@ def root() -> dict:
1413
base_url = os.getenv("BASE_URL", "http://localhost:8000")
1514
epoch = int(time.time() * 1000)
1615
meta = {
16+
"base_url": base_url,
1717
"version": __version__,
1818
"time": time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()),
1919
"epoch": epoch,
2020
"severity": "success",
2121
"message": f"NX AI says hello",
22-
"base_url": base_url
2322
}
2423
endpoints = [
24+
{"docs": "docs", "url": f"{base_url}/docs"},
2525
{"name": "health", "url": f"{base_url}/health"},
2626
{"name": "products", "url": f"{base_url}/products"}
2727
]

0 commit comments

Comments
 (0)