Files
backend/main.py
T
2026-06-21 19:59:14 +03:00

26 lines
585 B
Python

from fastapi import FastAPI
import tomllib
import logging
from routers import hosts, ip, tariffs
logging.basicConfig(level=logging.INFO)
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/v1/health")
async def health_check():
return {"status": "healthy", "service": "uvpn-backend"}
app.include_router(ip.router)
app.include_router(tariffs.router)
app.include_router(hosts.router)