summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/app.py
blob: 3b9ee4f6ad68f56c99dc2337b126bf33d0d6ff47 (plain) (blame)
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
"""
MeshBay Hub — FastAPI application.

POC endpoints are implemented in this file (in-memory storage).
Production implementation will use db/ with SQLAlchemy + PostgreSQL.
"""

from fastapi import FastAPI
from meshbay_hub import __version__
from meshbay_common import MNP_VERSION, MHP_VERSION

app = FastAPI(
    title="MeshBay Hub",
    version=__version__,
    description="MeshBay identity authority and group registry",
)

# TODO: import and include routers from api/ submodules
# from meshbay_hub.api import users, nodes, groups
# app.include_router(users.router, prefix="/v1")
# app.include_router(nodes.router, prefix="/v1")
# app.include_router(groups.router, prefix="/v1")


@app.get("/v1/hub/info")
async def hub_info() -> dict:
    return {
        "hub_id":      "meshbay.org",
        "mnp_version": MNP_VERSION,
        "mhp_version": MHP_VERSION,
    }