Artteiv's picture
feat: add menu item and module and migrations
d9eec61
raw
history blame
1.43 kB
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
import { AppController } from './app.controller.js';
import { AppService } from './app.service.js';
import { ConfigModule } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { configuration } from './config/config.js';
import { DatabaseConfigService } from './config/database.js';
import { AppLoggerMiddleware } from './common/middlewares/app-logger.middleware.js';
import { DeviceInfoMiddleware } from './common/middlewares/device-info.middleware.js';
import { UserModule } from './modules/user/user.module.js';
import { BranchModule } from './modules/branch/branch.module.js';
import { AuthenticationModule } from './modules/authentication/authentication.module.js';
import { MenuItemModule } from './modules/menu-item/menu-item.module.js';
@Module({
imports: [
ConfigModule.forRoot({
isGlobal: true,
load: [configuration],
}),
TypeOrmModule.forRootAsync({
imports: [ConfigModule],
useClass: DatabaseConfigService,
}),
UserModule,
BranchModule,
AuthenticationModule,
MenuItemModule,
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule implements NestModule {
configure(consumer: MiddlewareConsumer): void {
consumer.apply(AppLoggerMiddleware).forRoutes('*');
consumer.apply(DeviceInfoMiddleware).forRoutes('*');
}
}