xesite/src/handlers/mod.rs

29 lines
899 B
Rust
Raw Normal View History

2020-07-12 23:26:53 +00:00
use crate::{
app::State,
2020-07-12 23:30:01 +00:00
templates::{self, Html, RenderRucte},
2020-07-12 23:26:53 +00:00
};
use std::sync::Arc;
2020-07-12 23:30:01 +00:00
use warp::{http::Response, Rejection, Reply};
2020-07-12 22:39:50 +00:00
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())))
}
2020-07-12 23:37:01 +00:00
pub async fn signalboost(state: Arc<State>) -> Result<impl Reply, Rejection> {
let state = state.clone();
Response::builder().html(|o| templates::signalboost_html(o, state.signalboost.clone()))
}