add NestJS skeleton and GET /api/health-check.

Thin API bootstrap with config module and nullcart-style health route for Docker checks.
This commit is contained in:
2026-09-27 23:05:28 +02:00
parent aff4d2cc6f
commit a785ce775f
14 changed files with 4516 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import { registerAs } from '@nestjs/config';
import { AppConfig } from '../types/AppConfig';
import { NodeEnv } from '../types/NodeEnv';
const env = (key: string): string => process.env[key] || '';
const envInt = (key: string): number => parseInt(env(key), 10);
export const getAppConfig = (): AppConfig => {
const rawOrigins = env('CORS_ORIGINS');
return {
port: envInt('BACKEND_PORT'),
nodeEnv: env('NODE_ENV') as NodeEnv,
corsOrigins: rawOrigins
.split(',')
.map(o => o.trim())
.filter(Boolean)
};
};
export default registerAs('app', getAppConfig);