21 lines
442 B
Python
21 lines
442 B
Python
from fastapi import FastAPI
|
|
import tomllib
|
|
|
|
from routers import ip
|
|
|
|
def get_version_from_pyproject():
|
|
with open("pyproject.toml", "rb") as f:
|
|
data = tomllib.load(f)
|
|
return data["project"]["version"]
|
|
|
|
|
|
app = FastAPI(
|
|
title='uVPN Backend',
|
|
version=get_version_from_pyproject()
|
|
)
|
|
|
|
@app.get("/api/health")
|
|
async def health_check():
|
|
return {"status": "healthy", "service": "uvpn-backend"}
|
|
|
|
app.include_router(ip.router) |