//! Config API — exposes project metadata to the frontend. use axum::{extract::State, Json}; use serde::Serialize; use std::path::Path; use crate::AppState; #[derive(Serialize)] pub struct ConfigResponse { pub project_name: String, pub project_path: String, pub engram_url: String, } pub async fn get_config(State(state): State) -> Json { let project_path = &state.config.project_path; let project_name = Path::new(project_path) .file_name() .and_then(|n| n.to_str()) .unwrap_or(project_path) .to_string(); Json(ConfigResponse { project_name, project_path: project_path.clone(), engram_url: state.config.engram_url.clone(), }) }