mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-29 01:28:59 -05:00
refactor: remove providers and controllers from app module
This commit is contained in:
parent
e958a83b87
commit
176196bc35
1 changed files with 1 additions and 24 deletions
|
@ -2,22 +2,16 @@ import { HttpException, HttpStatus, Module } from "@nestjs/common";
|
||||||
|
|
||||||
import { ScheduleModule } from "@nestjs/schedule";
|
import { ScheduleModule } from "@nestjs/schedule";
|
||||||
import { AuthModule } from "./auth/auth.module";
|
import { AuthModule } from "./auth/auth.module";
|
||||||
import { JobsService } from "./jobs/jobs.service";
|
|
||||||
|
|
||||||
import { APP_GUARD } from "@nestjs/core";
|
|
||||||
import { MulterModule } from "@nestjs/platform-express";
|
import { MulterModule } from "@nestjs/platform-express";
|
||||||
import { ThrottlerGuard, ThrottlerModule } from "@nestjs/throttler";
|
import { ThrottlerModule } from "@nestjs/throttler";
|
||||||
import { Request } from "express";
|
import { Request } from "express";
|
||||||
import { ConfigModule } from "./config/config.module";
|
import { ConfigModule } from "./config/config.module";
|
||||||
import { ConfigService } from "./config/config.service";
|
import { ConfigService } from "./config/config.service";
|
||||||
import { EmailModule } from "./email/email.module";
|
import { EmailModule } from "./email/email.module";
|
||||||
import { FileController } from "./file/file.controller";
|
|
||||||
import { FileModule } from "./file/file.module";
|
import { FileModule } from "./file/file.module";
|
||||||
import { PrismaModule } from "./prisma/prisma.module";
|
import { PrismaModule } from "./prisma/prisma.module";
|
||||||
import { PrismaService } from "./prisma/prisma.service";
|
|
||||||
import { ShareController } from "./share/share.controller";
|
|
||||||
import { ShareModule } from "./share/share.module";
|
import { ShareModule } from "./share/share.module";
|
||||||
import { UserController } from "./user/user.controller";
|
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -51,22 +45,5 @@ import { UserController } from "./user/user.controller";
|
||||||
}),
|
}),
|
||||||
ScheduleModule.forRoot(),
|
ScheduleModule.forRoot(),
|
||||||
],
|
],
|
||||||
providers: [
|
|
||||||
ConfigService,
|
|
||||||
PrismaService,
|
|
||||||
JobsService,
|
|
||||||
{
|
|
||||||
provide: "CONFIG_VARIABLES",
|
|
||||||
useFactory: async (prisma: PrismaService) => {
|
|
||||||
return await prisma.config.findMany();
|
|
||||||
},
|
|
||||||
inject: [PrismaService],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
provide: APP_GUARD,
|
|
||||||
useClass: ThrottlerGuard,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
controllers: [UserController, ShareController, FileController],
|
|
||||||
})
|
})
|
||||||
export class AppModule {}
|
export class AppModule {}
|
||||||
|
|
Loading…
Add table
Reference in a new issue