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

34 lines
1.0 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-02-27 20:27:22 +01:00
import { EUser } from 'picsur-shared/dist/entities/user.entity';
import { EImage } from 'picsur-shared/dist/entities/image.entity';
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,
entities: [EUser, EImage],
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-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 {
}