Auth SuperOAuth (JWT validation + httpOnly cookie), entités users/characters/level_thresholds, lazy calculation endurance, seed 100 niveaux, config prod-ready (trust proxy, helmet, CORS, rate limit). Validé : health 200, auth flow, character CRUD, endurance lazy, 401 sans cookie.
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { ThrottlerModule } from '@nestjs/throttler';
|
|
import { AuthModule } from './auth/auth.module';
|
|
import { CharacterModule } from './character/character.module';
|
|
import { HealthController } from './common/health.controller';
|
|
|
|
@Module({
|
|
imports: [
|
|
ConfigModule.forRoot({ isGlobal: true }),
|
|
|
|
TypeOrmModule.forRootAsync({
|
|
imports: [ConfigModule],
|
|
inject: [ConfigService],
|
|
useFactory: (config: ConfigService) => ({
|
|
type: 'postgres',
|
|
url: config.get<string>('DATABASE_URL'),
|
|
autoLoadEntities: true,
|
|
synchronize: config.get('NODE_ENV') !== 'production',
|
|
logging: config.get('NODE_ENV') === 'development',
|
|
}),
|
|
}),
|
|
|
|
ThrottlerModule.forRoot([
|
|
{
|
|
ttl: 60_000,
|
|
limit: 20,
|
|
},
|
|
]),
|
|
|
|
AuthModule,
|
|
CharacterModule,
|
|
],
|
|
controllers: [HealthController],
|
|
})
|
|
export class AppModule {}
|