File size: 625 Bytes
57a889c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { Controller, Get } from '@nestjs/common';
import type { PublicConfig } from '@trek/shared';
import { DEFAULT_LANGUAGE } from '../../config';

/**
 * /api/config — public (unauthenticated) bootstrap config.
 *
 * Byte-identical to the legacy Express route (server/src/routes/publicConfig.ts):
 * no auth guard, returns the server's configured default language. Deliberately
 * has no service — it just surfaces a config constant, exactly like the original.
 */
@Controller('api/config')
export class ConfigController {
  @Get()
  getConfig(): PublicConfig {
    return { defaultLanguage: DEFAULT_LANGUAGE };
  }
}