feat: frontend routes (just the index html file for now)

This commit is contained in:
2026-10-18 15:31:19 -04:00
parent 3be16d3d58
commit 692a1a56a7
4 changed files with 33 additions and 1 deletions

11
src/server/frontend.rs Normal file
View File

@@ -0,0 +1,11 @@
use axum::response::Html;
use axum_extra::routing::TypedPath;
use serde::Deserialize;
#[derive(Deserialize, TypedPath)]
#[typed_path("/")]
pub struct IndexPath;
pub async fn spa(_: IndexPath) -> Html<&'static str> {
Html(include_str!("index.html"))
}

View File

@@ -6,11 +6,13 @@ use rand::Rng;
use rand::RngExt;
use secrecy::SecretString;
use std::sync::Arc;
use tower_http::cors::CorsLayer;
use typed_builder::TypedBuilder;
use url::Url;
mod chat;
mod decisions;
mod frontend;
mod embeddings;
mod models;
mod system_one;
@@ -46,6 +48,8 @@ pub fn create_router() -> Router<AppState> {
.typed_post(embeddings::create_embeddings)
.typed_post(system_one::create_system_one)
.typed_get(models::list_models)
.typed_get(frontend::spa)
.layer(CorsLayer::new())
}
pub fn create_app(state: AppState) -> Router<()> {