UNPKG

ams-ssk

Version:

NestJS AMS Library for file management

38 lines 1.51 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setupSwagger = setupSwagger; const swagger_1 = require("@nestjs/swagger"); const fs = require("fs"); function setupSwagger(app) { const config = new swagger_1.DocumentBuilder() .setTitle('File Storage API') .setVersion('1.0') .build(); const document = swagger_1.SwaggerModule.createDocument(app, config); fs.writeFileSync('./swagger-spec.json', JSON.stringify(document, null, 2)); swagger_1.SwaggerModule.setup('api-docs', app, document, { swaggerOptions: { persistAuthorization: true, docExpansion: 'none', filter: true, showRequestDuration: true, syntaxHighlight: { theme: 'monokai', }, tryItOutEnabled: true, displayRequestDuration: true, }, customSiteTitle: 'File Storage API Documentation', customCss: ` .swagger-ui .topbar { display: none } .swagger-ui .info { margin: 20px 0 } .swagger-ui .info .title { color: #2c3e50 } .swagger-ui .info__contact { padding: 1rem 0 } .swagger-ui .markdown p { margin: 1em 0 } .swagger-ui .btn.execute { background-color: #2c3e50 } .swagger-ui .btn.execute:hover { background-color: #34495e } `, customfavIcon: 'https://nestjs.com/favicon.ico', }); } //# sourceMappingURL=swagger.config.js.map