mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 18:27:05 +00:00
Add super admin configuration and service
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user