25 lines
545 B
Python
25 lines
545 B
Python
from fastapi import FastAPI
|
|
import tomllib
|
|
import logging
|
|
|
|
from routers import 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) |