This repository has been archived on 2026-05-05. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
el-ide-retired/vessels/el-ide-server/src/api/config.rs
T
Will Anderson b2c22e6616 rename crates/ → vessels/ — El's word for buildable units
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.
2026-04-30 15:34:20 -05:00

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(),
})
}