Archived
Подключены routers шаблонов и инстансов
This commit is contained in:
+5
-4
@@ -7,7 +7,7 @@ from sqlalchemy import create_engine, text
|
|||||||
from . import models
|
from . import models
|
||||||
from .config import settings
|
from .config import settings
|
||||||
from .database import Base, engine
|
from .database import Base, engine
|
||||||
from .routers import admin, auth
|
from .routers import admin, auth, instances, templates
|
||||||
|
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.INFO,
|
level=logging.INFO,
|
||||||
@@ -17,7 +17,7 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
app = FastAPI(
|
app = FastAPI(
|
||||||
title="Proxmox VPS Panel Secure",
|
title="Proxmox VPS Panel Secure",
|
||||||
version="1.1.0",
|
version="1.2.0",
|
||||||
)
|
)
|
||||||
|
|
||||||
origins = [item.strip() for item in settings.allow_origins.split(",") if item.strip()]
|
origins = [item.strip() for item in settings.allow_origins.split(",") if item.strip()]
|
||||||
@@ -32,11 +32,12 @@ app.add_middleware(
|
|||||||
allow_headers=["Authorization", "Content-Type"],
|
allow_headers=["Authorization", "Content-Type"],
|
||||||
)
|
)
|
||||||
|
|
||||||
# Временное создание базовых таблиц до добавления Alembic-миграций.
|
# Временное создание таблиц до добавления Alembic-миграций.
|
||||||
# После появления миграций этот вызов должен быть удалён.
|
|
||||||
Base.metadata.create_all(bind=engine)
|
Base.metadata.create_all(bind=engine)
|
||||||
app.include_router(auth.router)
|
app.include_router(auth.router)
|
||||||
app.include_router(admin.router)
|
app.include_router(admin.router)
|
||||||
|
app.include_router(templates.router)
|
||||||
|
app.include_router(instances.router)
|
||||||
|
|
||||||
|
|
||||||
@app.get("/health")
|
@app.get("/health")
|
||||||
|
|||||||
Reference in New Issue
Block a user