MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / load

Method load

packages/sync/src/config-manager.ts:44–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 {

Callers 9

updateMethod · 0.95
regenerateTokenMethod · 0.95
startFunction · 0.45
autoStartFunction · 0.45
setEnabledFunction · 0.45
setPortFunction · 0.45
getConfigFunction · 0.45
registerApiHandlersFunction · 0.45

Calls 3

getConfigPathMethod · 0.95
parseMethod · 0.80
errorMethod · 0.65

Tested by

no test coverage detected