Express API server on :3100 exposing all Coolify operations: - CRUD for apps, env vars, servers - Full upsert pipeline (create/update + env + route + deploy) - Drift detection, Traefik route management via SSH - Scalar API docs at /reference, OpenAPI 3.1 spec UI: New Coolify page with app cards, deploy/delete actions, env var expansion. Sidebar nav + React Query hooks + fetch client. Both UI and LLM/CLI use the same HTTP endpoints. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
25 lines
659 B
JavaScript
25 lines
659 B
JavaScript
import { readFileSync, existsSync } from 'fs';
|
|
import { join, dirname } from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
|
// Shared config from gitea.repo.management
|
|
const CONFIG_PATH = join(__dirname, '..', '..', '..', 'gitea.repo.management', 'config.json');
|
|
|
|
let _cached = null;
|
|
|
|
export function loadConfig() {
|
|
if (_cached) return _cached;
|
|
if (!existsSync(CONFIG_PATH)) {
|
|
throw new Error(`Config not found at ${CONFIG_PATH}`);
|
|
}
|
|
_cached = JSON.parse(readFileSync(CONFIG_PATH, 'utf8'));
|
|
return _cached;
|
|
}
|
|
|
|
export function reloadConfig() {
|
|
_cached = null;
|
|
return loadConfig();
|
|
}
|