Add super admin configuration and service

This commit is contained in:
faris Aljohari
2024-05-11 21:02:25 +03:00
parent d1fa15cff1
commit 3e9fff3822
5 changed files with 109 additions and 4 deletions

View File

@ -4,6 +4,7 @@ import rateLimit from 'express-rate-limit';
import helmet from 'helmet';
import { setupSwaggerAuthentication } from '../libs/common/src/util/user-auth.swagger.utils';
import { ValidationPipe } from '@nestjs/common';
import { SuperAdminService } from '@app/common/helper/services/super.admin.sarvice';
async function bootstrap() {
const app = await NestFactory.create(AuthModule);
@ -33,6 +34,9 @@ async function bootstrap() {
},
}),
);
// Create super admin user
const superAdminService = app.get(SuperAdminService);
await superAdminService.createSuperAdminIfNotFound();
await app.listen(process.env.PORT || 4000);
}