import { Router } from "express";
import { env } from "../../config/env.js";

export const appVersionRouter = Router();

appVersionRouter.get("/app-version", (_req, res) => {
  res.json({
    latestVersion: env.APP_LATEST_VERSION || null,
    minSupportedVersion: env.APP_MIN_SUPPORTED_VERSION || null,
    updateUrl: env.APP_UPDATE_URL || null,
    message: env.APP_UPDATE_MESSAGE || "Доступна новая версия приложения"
  });
});
