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

33 lines
964 B
TypeScript
Raw Normal View History

2022-02-21 10:46:03 +01:00
import { Module } 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 { UserEntity } from './collections/userdb/user.entity';
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-21 22:36:47 +01:00
import { ImageEntity } from './collections/imagedb/image.entity';
2022-02-21 10:46:03 +01:00
const backendRoutes = ['i', 'api'];
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-02-21 22:17:44 +01:00
entities: [UserEntity, ImageEntity],
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-21 14:53:21 +01:00
],
2022-02-21 10:46:03 +01:00
})
export class AppModule {}