cdb571c509
- packages/shared: VersionResponse { name, version, channel, commit, buildTime }
- apps/api: health/app-version.ts (getAppVersion mit ||-Vorgaben dev/dev, formatAppVersionLine),
HealthController.getVersion delegiert (bleibt @Public, T-KU1-03), main.ts protokolliert
"Tessera API <version> (<channel>) <commit>" beim Start; neuer Spec mit 6 Tests
- apps/web: lib/app-version.ts (NEXT_PUBLIC_APP_* mit vollem Literalnamen, loadApiVersion
memoisiert und still bei Fehler), AppVersionBadge unten in der Seitenleiste (auch mobil,
nicht eingeklappt), sidebar.channel.{beta,live,dev} in de/en; 5 + 4 + 1 neue Tests
- Suiten: API 65 Dateien / 1060 Tests, Web 40 / 243, tsc in shared/api/web Exit 0
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018N9CD3ebPKm1b32bPpBknY
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
import { ValidationPipe } from '@nestjs/common';
|
|
import { ConfigService } from '@nestjs/config';
|
|
import { NestFactory } from '@nestjs/core';
|
|
import cookieParser from 'cookie-parser';
|
|
import { AppModule } from './app.module';
|
|
import { formatAppVersionLine } from './health/app-version';
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create(AppModule);
|
|
const configService = app.get(ConfigService);
|
|
|
|
// Cookie parser for JWT httpOnly cookies
|
|
app.use(cookieParser());
|
|
|
|
// Global validation pipe with whitelist and transform
|
|
app.useGlobalPipes(
|
|
new ValidationPipe({
|
|
whitelist: true,
|
|
transform: true,
|
|
}),
|
|
);
|
|
|
|
// CORS with credentials for cross-origin cookie support (Pitfall 4)
|
|
const corsOrigin = configService.get<string>(
|
|
'CORS_ORIGIN',
|
|
'http://localhost:3000',
|
|
);
|
|
app.enableCors({
|
|
origin: corsOrigin,
|
|
credentials: true,
|
|
});
|
|
|
|
await app.listen(3001);
|
|
console.log('Tessera API running on port 3001');
|
|
console.log(formatAppVersionLine());
|
|
}
|
|
|
|
bootstrap();
|