xesite/src/handlers/mod.rs

27 lines
733 B
Rust
Raw Normal View History

2020-07-12 23:26:53 +00:00
use crate::{
app::State,
templates::{self, RenderRucte, Html},
};
use std::sync::Arc;
2020-07-12 22:39:50 +00:00
use warp::{
http::{Response, StatusCode},
path, Filter, Rejection, Reply,
};
pub async fn index() -> Result<impl Reply, Rejection> {
Response::builder().html(|o| templates::index_html(o))
}
2020-07-12 22:58:38 +00:00
pub async fn contact() -> Result<impl Reply, Rejection> {
Response::builder().html(|o| templates::contact_html(o))
}
pub async fn feeds() -> Result<impl Reply, Rejection> {
Response::builder().html(|o| templates::feeds_html(o))
}
2020-07-12 23:26:53 +00:00
pub async fn resume(state: Arc<State>) -> Result<impl Reply, Rejection> {
let state = state.clone();
Response::builder().html(|o| templates::resume_html(o, Html(state.resume.clone())))
}