feat: implement API versioning /api/v1/

- All backend routers moved to /api/v1/ prefix
- Frontend BASE_URL updated to /api/v1
- Setup redirect middleware updated to redirect to /api/v1/setup
- Health router path fixed: prefix=/api/v1/health, @router.get('')
- conftest.py: set server_status=online for test fixture
- Created Docs/API_VERSIONING.md with deprecation policy
- Updated Docs/Backend-Development.md with versioning section
- Updated Instructions.md curl examples

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-05-02 21:29:30 +02:00
parent 0d5882b32f
commit cc6dbcf3f0
51 changed files with 1886 additions and 671 deletions

View File

@@ -17,8 +17,8 @@
import { ErrorResponse } from "../types/response";
import { ENDPOINTS } from "./endpoints";
/** Base URL for all API calls. Falls back to `/api` in production. */
const BASE_URL: string = import.meta.env.VITE_API_URL ?? "/api";
/** Base URL for all API calls. Falls back to `/api/v1` in production. */
const BASE_URL: string = import.meta.env.VITE_API_URL ?? "/api/v1";
/** Standard header name for correlation IDs (matches backend convention) */
const CORRELATION_ID_HEADER: string = "X-Correlation-ID";

View File

@@ -107,7 +107,7 @@ export const ENDPOINTS = {
configAction: (name: string): string => `/config/actions/${encodeURIComponent(name)}`,
configActionRaw: (name: string): string => `/config/actions/${encodeURIComponent(name)}/raw`,
configActionParsed: (name: string): string =>
`/config/actions/${encodeURIComponent(name)}/parsed`,
`/config/actions/${encodeURIComponent(name)}/parsed",
// fail2ban log viewer (Task 2)
configFail2BanLog: "/config/fail2ban-log",