summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 21eac18..b4801ad 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -8,6 +8,7 @@ use warp::{path, Filter};
use std::str::FromStr;
pub mod blog;
+pub mod projects;
mod internal;
pub mod misc;
@@ -35,9 +36,17 @@ async fn main() -> Result<()> {
.and(give_site_state(state.clone()))
.and_then(blog::handlers::post);
+ let project_index = warp::path!("projects")
+ .and(give_site_state(state.clone()))
+ .and_then(projects::handlers::list);
+ let project = warp::path!("projects" / String)
+ .and(give_site_state(state.clone()))
+ .and_then(projects::handlers::project);
+
let static_files = warp::path("static").and(warp::fs::dir("./statics"));
let site = index.or(about)
.or(blog_index.or(blog_post))
+ .or(project_index.or(project))
.or(static_files)
.with(warp::log("site"));