You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
990 B
34 lines
990 B
|
2 years ago
|
import { MiddlewareConsumer, Module, RequestMethod } from '@nestjs/common';
|
||
|
|
import { AppController } from './app.controller';
|
||
|
|
import { AppService } from './app.service';
|
||
|
|
|
||
|
|
import { SequelizeModule } from '@nestjs/sequelize';
|
||
|
|
import { AuthModule } from './auth/auth.module';
|
||
|
|
import { UsersService } from './users/users.service';
|
||
|
|
import { UsersModule } from './users/users.module';
|
||
|
|
|
||
|
|
import { LoggerMiddleware } from './auth/logger.middleware';
|
||
|
|
import { SeasonsController } from './seasons/seasons.controller';
|
||
|
|
|
||
|
|
@Module({
|
||
|
|
imports: [
|
||
|
|
SequelizeModule.forRoot({
|
||
|
|
dialect: 'sqlite',
|
||
|
|
storage: 'data/data.db',
|
||
|
|
autoLoadModels: true,
|
||
|
|
synchronize: true,
|
||
|
|
}),
|
||
|
|
AuthModule,
|
||
|
|
UsersModule,
|
||
|
|
],
|
||
|
|
controllers: [AppController, SeasonsController],
|
||
|
|
providers: [AppService, UsersService],
|
||
|
|
})
|
||
|
|
export class AppModule {
|
||
|
|
configure(consumer: MiddlewareConsumer) {
|
||
|
|
consumer
|
||
|
|
.apply(LoggerMiddleware)
|
||
|
|
.forRoutes({ path: '*', method: RequestMethod.ALL });
|
||
|
|
}
|
||
|
|
}
|