feat: Sprint 1 — backend fondations TetaRdPG
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.
This commit is contained in:
14
src/database/data-source.ts
Normal file
14
src/database/data-source.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import 'reflect-metadata';
|
||||
import { DataSource } from 'typeorm';
|
||||
import { User } from '../user/user.entity';
|
||||
import { Character } from '../character/entities/character.entity';
|
||||
import { LevelThreshold } from '../character/entities/level-threshold.entity';
|
||||
|
||||
// DataSource pour le CLI TypeORM (migrations manuelles)
|
||||
export const AppDataSource = new DataSource({
|
||||
type: 'postgres',
|
||||
url: process.env.DATABASE_URL ?? 'postgresql://tetardpg:password@localhost:5432/tetardpg',
|
||||
entities: [User, Character, LevelThreshold],
|
||||
migrations: ['src/database/migrations/*.ts'],
|
||||
synchronize: false,
|
||||
});
|
||||
Reference in New Issue
Block a user