diff options
author | Cara Salter <cara@devcara.com> | 2022-02-28 09:34:37 -0500 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2022-02-28 09:34:37 -0500 |
commit | d6126294bf27c93e0f05cbd3129e9b20493db6d0 (patch) | |
tree | 9643f07b01d05449ca9fdcfb5b9076b747f7a5e8 /src | |
parent | a610350e7e012a790e63fb86cbcb61effb041105 (diff) | |
download | site-d6126294bf27c93e0f05cbd3129e9b20493db6d0.tar.gz site-d6126294bf27c93e0f05cbd3129e9b20493db6d0.zip |
Nix and updated templates
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 3 | ||||
-rw-r--r-- | src/misc/mod.rs | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index a83c1ae..21eac18 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,7 @@ async fn main() -> Result<()> { let state = Arc::new(internal::init().await?); let index = warp::get().and(path::end().and_then(misc::handlers::index)); + let about = warp::path!("about").and_then(misc::handlers::about); let blog_index = warp::path!("blog") .and(give_site_state(state.clone())) @@ -35,7 +36,7 @@ async fn main() -> Result<()> { .and_then(blog::handlers::post); let static_files = warp::path("static").and(warp::fs::dir("./statics")); - let site = index + let site = index.or(about) .or(blog_index.or(blog_post)) .or(static_files) .with(warp::log("site")); diff --git a/src/misc/mod.rs b/src/misc/mod.rs index c2992cc..b5b3262 100644 --- a/src/misc/mod.rs +++ b/src/misc/mod.rs @@ -6,4 +6,8 @@ pub mod handlers { pub async fn index() -> Result<impl Reply, Rejection> { Response::builder().html(|o| templates::index_html(o)) } + + pub async fn about() -> Result<impl Reply, Rejection> { + Response::builder().html(|o| templates::about_html(o)) + } } |