36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { AppController } from './app.controller';
|
|
import { AppService } from './app.service';
|
|
import { GraphQLModule } from '@nestjs/graphql';
|
|
import { MercuriusDriver, MercuriusDriverConfig } from '@nestjs/mercurius';
|
|
import { EventsModule } from './events/events.module';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { EventEntity } from './events/events.entity';
|
|
|
|
@Module({
|
|
imports: [
|
|
GraphQLModule.forRoot<MercuriusDriverConfig>({
|
|
driver: MercuriusDriver,
|
|
graphiql: true,
|
|
autoSchemaFile: true
|
|
} as MercuriusDriverConfig),
|
|
EventsModule,
|
|
TypeOrmModule.forRoot({
|
|
type: 'mysql',
|
|
host: process.env.DB_HOST || 'database',
|
|
port: parseInt(process.env.DB_PORT || "3306"),
|
|
username: process.env.DB_USER || 'root',
|
|
password: process.env.DB_PASSWORD || 'root',
|
|
database: process.env.DB_NAME || 'ritzenbergen',
|
|
synchronize: true,
|
|
entities: [EventEntity]
|
|
}),
|
|
|
|
|
|
],
|
|
controllers: [AppController],
|
|
providers: [AppService, AppController],
|
|
|
|
})
|
|
export class AppModule {}
|