From 7db680831dff79f4bbd995920bd3148247a92f58 Mon Sep 17 00:00:00 2001 From: guus <_@guusw.nl> Date: Sat, 25 Oct 2025 18:11:12 +0800 Subject: [PATCH] WIP --- posts/hello-world/test.txt | 1 + project_templates/.nvim.lua | 3 ++- src/main.rs | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 posts/hello-world/test.txt diff --git a/posts/hello-world/test.txt b/posts/hello-world/test.txt new file mode 100644 index 0000000..a84a95a --- /dev/null +++ b/posts/hello-world/test.txt @@ -0,0 +1 @@ +This is a test file for hello-world post diff --git a/project_templates/.nvim.lua b/project_templates/.nvim.lua index 2685f92..642bd6e 100644 --- a/project_templates/.nvim.lua +++ b/project_templates/.nvim.lua @@ -120,7 +120,8 @@ if dap_ok then -- We need to query this to get the sysroot -- ls $(rustc --print sysroot)/lib/rustlib/etc local rust_path = vim.fn.system("rustc --print sysroot") - -- vim.print(rust_path) + -- trim trailing newline + rust_path = local lldb_init = { "command script import "..rust_path.."/lib/rustlib/etc/lldb_lookup.py", "command source "..rust_path.."lib/rustlib/etc/lldb_commands", diff --git a/src/main.rs b/src/main.rs index 7589a38..37239b0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,6 +11,7 @@ use axum::{ }; use std::sync::Arc; use tokio::sync::RwLock; +use tower_http::services::ServeDir; #[derive(Clone)] struct AppState { @@ -29,6 +30,7 @@ async fn main() { let app = Router::new() .route("/", get(index_handler)) + .nest_service("/posts", ServeDir::new("posts")) .route("/:page", get(all_handler)) .route("/p/:post_name", get(post_handler)) .with_state(app_state);