Archived
b2c22e6616
Per the consolidation onto El: 'crates' is the Rust word, 'vessel' is El's (per spec/language.md §15). The directory rename is the structural marker that this slot holds an El buildable unit, even if its current contents are still Rust pending port. Mechanical: git mv crates vessels, sed workspace members and any path dependencies, update CI workflow paths, update README references. Cross-repo path dependencies (`../foo/crates/bar`) updated workspace- wide so cargo metadata still resolves where the Rust still builds.
30 lines
746 B
Rust
30 lines
746 B
Rust
//! 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<AppState>) -> Json<ConfigResponse> {
|
|
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(),
|
|
})
|
|
}
|