> ## Documentation Index
> Fetch the complete documentation index at: https://docs.erixcel.com/llms.txt
> Use this file to discover all available pages before exploring further.

# swagger.core.ts

Configura Swagger/OpenAPI para documentar los endpoints de tu backend.

```typescript swagger.core.ts theme={null}
import { INestApplication, Logger } from '@nestjs/common';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';

export function setupSwagger(app: INestApplication) {
  const config = new DocumentBuilder()
    .setTitle('API Documentation')
    .setDescription('API endpoints for backend-transporte<br><a href="/api-json" target="_blank">Download Swagger JSON</a>')
    .setVersion('1.0')
    .addBearerAuth()
    .build();

  const document = SwaggerModule.createDocument(app, config);
  SwaggerModule.setup('api', app, document, {
    swaggerOptions: {
      docExpansion: 'none',
      filter: true,
    },
  });
}
```

**Personaliza:** cambia `backend-transporte` por el nombre de tu proyecto. Con esta configuración, la interfaz se muestra en `/api` y el documento JSON en `/api-json`. Necesitas tener instalado `@nestjs/swagger`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.