Backend (Phase 8.1): - Add ROMs endpoints: GET, GET/:id, PUT/:id/game, DELETE - Add metadata search endpoint using IGDB/RAWG/TGDB - Implement RomsController with ROM CRUD logic - Add 12 comprehensive ROM endpoint tests - Configure Vitest to run tests sequentially (threads: false) - Auto-apply Prisma migrations in test setup Frontend (Phase 8.2 + 8.3): - Create ROM types: RomFile, Artwork, EnrichedGame - Extend API client with roms and metadata namespaces - Implement 5 custom hooks with TanStack Query - Create ScanDialog, MetadataSearchDialog, RomCard components - Rewrite roms.tsx page with table and all actions - Add 37 comprehensive component and page tests All 122 tests passing: 63 backend + 59 frontend Lint: 0 errors, only unused directive warnings
33 lines
1023 B
TypeScript
33 lines
1023 B
TypeScript
import Fastify, { FastifyInstance } from 'fastify';
|
|
import cors from '@fastify/cors';
|
|
import helmet from '@fastify/helmet';
|
|
import rateLimit from '@fastify/rate-limit';
|
|
import healthRoutes from './routes/health';
|
|
import importRoutes from './routes/import';
|
|
import gamesRoutes from './routes/games';
|
|
import romsRoutes from './routes/roms';
|
|
import metadataRoutes from './routes/metadata';
|
|
|
|
export function buildApp(): FastifyInstance {
|
|
const app: FastifyInstance = Fastify({
|
|
logger: false,
|
|
});
|
|
|
|
void app.register(cors, { origin: true });
|
|
void app.register(helmet);
|
|
void app.register(rateLimit, { max: 1000, timeWindow: '1 minute' });
|
|
void app.register(healthRoutes, { prefix: '/api' });
|
|
void app.register(importRoutes, { prefix: '/api' });
|
|
void app.register(gamesRoutes, { prefix: '/api' });
|
|
void app.register(romsRoutes, { prefix: '/api' });
|
|
void app.register(metadataRoutes, { prefix: '/api' });
|
|
|
|
return app;
|
|
}
|
|
|
|
/**
|
|
* Metadatos:
|
|
* Autor: GitHub Copilot
|
|
* Última actualización: 2026-02-07
|
|
*/
|