feat(docs): inclui documentacao de endpoints auth com Swagger UI

This commit is contained in:
2026-04-28 18:53:44 -05:00
parent 36a1875ee6
commit 80262c4be3
2 changed files with 633 additions and 0 deletions

31
server/routes/docs.get.ts Normal file
View File

@@ -0,0 +1,31 @@
export default defineEventHandler((event) => {
setHeader(event, 'Content-Type', 'text/html; charset=utf-8')
return `<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Sistema Auth — API Docs</title>
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@5/swagger-ui.css" />
<style>
body { margin: 0; }
.topbar { 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>
SwaggerUIBundle({
url: '/openapi.json',
dom_id: '#swagger-ui',
presets: [SwaggerUIBundle.presets.apis, SwaggerUIBundle.SwaggerUIStandalonePreset],
layout: 'BaseLayout',
deepLinking: true,
tryItOutEnabled: true,
})
</script>
</body>
</html>`
})