mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-17 05:09:26 +00:00
add dark theme to swagger docs
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { join } from 'path'
|
||||
import * as process from 'process'
|
||||
|
||||
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'
|
||||
import { CqrsModule } from '@nestjs/cqrs'
|
||||
import { ServeStaticModule } from '@nestjs/serve-static'
|
||||
import { MailerModule } from '@nestjs-modules/mailer'
|
||||
|
||||
import { FileUploadService } from './infrastructure/file-upload-service/file-upload.service'
|
||||
@@ -23,6 +25,9 @@ import { ConfigModule } from './settings/config.module'
|
||||
DecksModule,
|
||||
CardsModule,
|
||||
PrismaModule,
|
||||
ServeStaticModule.forRoot({
|
||||
rootPath: join(__dirname, '..', 'client'),
|
||||
}),
|
||||
MailerModule.forRoot({
|
||||
transport: {
|
||||
host: process.env.AWS_SES_SMTP_HOST,
|
||||
|
||||
@@ -28,7 +28,10 @@ async function bootstrap() {
|
||||
.build()
|
||||
const document = SwaggerModule.createDocument(app, config)
|
||||
|
||||
SwaggerModule.setup('docs', app, document)
|
||||
SwaggerModule.setup('docs', app, document, {
|
||||
customJs: '/swagger-ui.js',
|
||||
customCssUrl: '/swagger-themes/dark.css',
|
||||
})
|
||||
pipesSetup(app)
|
||||
app.useGlobalFilters(new HttpExceptionFilter())
|
||||
await app.listen(process.env.PORT || 3000)
|
||||
@@ -38,7 +41,7 @@ async function bootstrap() {
|
||||
}
|
||||
|
||||
try {
|
||||
bootstrap()
|
||||
void bootstrap()
|
||||
} catch (e) {
|
||||
console.log('BOOTSTRAP CALL FAILED')
|
||||
console.log('ERROR: ')
|
||||
|
||||
Reference in New Issue
Block a user