import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import env from 'src/env';

export default function (app) {
  const config = new DocumentBuilder()
    .setTitle(env.swagger.title)
    .setVersion(env.swagger.version)
    .addBearerAuth({ type: 'http', scheme: 'bearer', bearerFormat: 'JWT' })
    .build();
  const document = SwaggerModule.createDocument(app, config);
  SwaggerModule.setup(env.swagger.path, app, document);
}
