Skip to content

Commit 046576f

Browse files
Merge pull request #33 from goldlabelapps/staging
Update meta, prospects endpoints, and CORS origins
2 parents 3641848 + f461e55 commit 046576f

5 files changed

Lines changed: 11 additions & 16 deletions

File tree

app/api/prospects/prospects.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
@router.get("/prospects")
1212
def root() -> dict:
1313
"""GET /prospects endpoint."""
14-
meta = make_meta("success", "Prospects start")
14+
meta = make_meta("success", "Prospects endpoint")
1515
data = [
1616
{"init": f"{base_url}/prospects/init"},
17-
{"search": f"{base_url}/prospects/search/?query=example"},
17+
{"search": f"{base_url}/prospects/search/?query=karen"},
1818
]
1919
return {"meta": meta, "data": data}
2020

@@ -189,6 +189,7 @@ def slugify(text):
189189
"list": sub_departments
190190
}
191191
},
192+
"message": "This is a placeholder for prospects/init."
192193
}
193194
return {"meta": meta, "data": data}
194195

app/api/root.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,15 @@ def root() -> dict:
1313
base_url = os.getenv("BASE_URL", "http://localhost:8000")
1414
epoch = int(time.time() * 1000)
1515
meta = {
16-
"title": "How can I help?",
16+
"title": "NX-AI",
1717
"severity": "success",
1818
"version": __version__,
1919
"endpoint": base_url,
2020
"time": epoch,
2121
}
2222
endpoints = [
23+
{"name": "docs", "url": f"{base_url}/docs"},
2324
{"name": "health", "url": f"{base_url}/health"},
2425
{"name": "prospects", "url": f"{base_url}/prospects"},
25-
# {
26-
# "name": "products",
27-
# "url": f"{base_url}/products",
28-
# "children": [
29-
# {"name": "seed", "url": f"{base_url}/products/seed"},
30-
# {"name": "update", "url": f"{base_url}/products/update"}
31-
# ]
32-
# },
33-
{"name": "docs", "url": f"{base_url}/docs"},
3426
]
3527
return {"meta": meta, "data": endpoints}

app/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
allow_origins=[
1919
"http://localhost:1999",
2020
"https://goldlabel.pro",
21-
"https://soho.goldlabel.pro",
22-
"https://echopay.goldlabel.pro",
21+
"https://free.goldlabel.pro",
2322
],
2423
allow_credentials=True,
2524
allow_methods=["*"],

app/utils/make_meta.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ def make_meta(severity: str, title: str) -> dict:
1111
"title": title,
1212
"version": __version__,
1313
"endpoint": f"{base_url}/prospects",
14+
"base": base_url,
15+
"base_url": base_url,
16+
"message": title,
1417
"time": epoch,
1518
}

tests/test_make_meta.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ def test_make_meta_basic(monkeypatch):
1313
assert meta["severity"] == "info"
1414
assert meta["title"] == "Test Title"
1515
assert meta["version"] == __version__
16-
assert meta["base_url"] == "http://testserver:9000"
16+
assert meta["base"] == "http://testserver:9000"
1717
assert before <= meta["time"] <= after
1818

1919
def test_make_meta_default_base_url(monkeypatch):
2020
monkeypatch.delenv("BASE_URL", raising=False)
2121
meta = make_meta("success", "Default URL")
22-
assert meta["base_url"] == "http://localhost:8000"
22+
assert meta["base"] == "http://localhost:8000"
2323

2424
def test_make_meta_time_is_int():
2525
meta = make_meta("info", "Time Test")

0 commit comments

Comments
 (0)