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:
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user