Files
Grow/src/app/api-docs/route.ts
T
2026-06-15 23:34:38 +02:00

31 lines
995 B
TypeScript

export async function GET() {
const html = `<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Grow API — Documentation</title>
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@5/swagger-ui.css" />
<style>
.swagger-ui .topbar .download-url-wrapper { display: none; }
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js"></script>
<script src="https://unpkg.com/swagger-ui-dist@5/swagger-ui-standalone-preset.js"></script>
<script>
SwaggerUIBundle({
url: "/api/v1/spec",
dom_id: "#swagger-ui",
presets: [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset],
layout: "StandaloneLayout",
deepLinking: true,
persistAuthorization: true,
});
</script>
</body>
</html>`;
return new Response(html, { headers: { "Content-Type": "text/html" } });
}