()
| 42 | } |
| 43 | |
| 44 | load(): ApiServerConfig { |
| 45 | try { |
| 46 | const filePath = this.getConfigPath() |
| 47 | if (fs.existsSync(filePath)) { |
| 48 | const raw = fs.readFileSync(filePath, 'utf-8') |
| 49 | const parsed = JSON.parse(raw) as Partial<ApiServerConfig> |
| 50 | return { ...DEFAULT_CONFIG, ...parsed } |
| 51 | } |
| 52 | } catch (err) { |
| 53 | this.logger.error('[Config] Failed to load config', err) |
| 54 | } |
| 55 | return { ...DEFAULT_CONFIG } |
| 56 | } |
| 57 | |
| 58 | save(config: ApiServerConfig): void { |
| 59 | try { |
no test coverage detected