Files
Picsur/backend/src/app.module.ts

36 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-02-28 10:29:40 +01:00
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
2022-02-21 14:53:21 +01:00
import { TypeOrmModule } from '@nestjs/typeorm';
import { AuthModule } from './routes/api/auth/auth.module';
2022-02-21 22:36:47 +01:00
import { ImageModule } from './routes/image/imageroute.module';
2022-02-23 19:09:53 +01:00
import { ServeStaticModule } from '@nestjs/serve-static';
2022-02-21 14:53:21 +01:00
import Config from './env';
2022-02-25 14:13:19 +01:00
import { DemoManagerModule } from './managers/demo/demomanager.module';
2022-03-03 22:48:03 +01:00
import { EImageBackend } from './models/entities/image.entity';
import { EUserBackend } from './models/entities/user.entity';
2022-03-04 14:37:00 +01:00
import { PrefModule } from './routes/api/pref/pref.module';
2022-02-21 10:46:03 +01:00
@Module({
2022-02-21 14:53:21 +01:00
imports: [
TypeOrmModule.forRoot({
type: 'postgres',
host: Config.database.host,
port: Config.database.port,
username: Config.database.username,
password: Config.database.password,
database: Config.database.database,
synchronize: true,
2022-03-01 22:05:59 +01:00
entities: [EUserBackend, EImageBackend],
2022-02-21 14:53:21 +01:00
}),
2022-02-23 19:09:53 +01:00
ServeStaticModule.forRoot({
rootPath: Config.static.frontendRoot,
}),
2022-02-21 14:53:21 +01:00
AuthModule,
2022-02-21 22:36:47 +01:00
ImageModule,
2022-02-25 14:13:19 +01:00
DemoManagerModule,
2022-03-04 14:37:00 +01:00
PrefModule,
2022-02-21 14:53:21 +01:00
],
2022-02-21 10:46:03 +01:00
})
2022-02-28 10:29:40 +01:00
export class AppModule {
}