fix(api-docs): use relative spec URL — req.url returns internal Docker address

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 18:29:54 +02:00
parent 5d7ef5fa3b
commit e5acf75cac
+2 -3
View File
@@ -1,5 +1,4 @@
export async function GET(req: Request) { export async function GET() {
const base = new URL(req.url).origin;
const html = `<!DOCTYPE html> const html = `<!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
@@ -21,7 +20,7 @@ export async function GET(req: Request) {
<script src="https://unpkg.com/swagger-ui-dist@5/swagger-ui-standalone-preset.js"></script> <script src="https://unpkg.com/swagger-ui-dist@5/swagger-ui-standalone-preset.js"></script>
<script> <script>
SwaggerUIBundle({ SwaggerUIBundle({
url: "${base}/api/v1/spec", url: "/api/v1/spec",
dom_id: "#swagger-ui", dom_id: "#swagger-ui",
presets: [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset], presets: [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset],
layout: "StandaloneLayout", layout: "StandaloneLayout",