add additional pages and set base styles

This commit is contained in:
Nate
2021-09-15 18:28:38 -04:00
parent 51f0250466
commit fc7dc73f57
16 changed files with 187 additions and 283 deletions
+15
View File
@@ -0,0 +1,15 @@
use crate::{AppState, Request, RequestExt};
use std::sync::Arc;
use tide::http::mime;
pub fn add_routes(community: &mut tide::Server<Arc<AppState>>) {
community.at("/community").get(get_community);
}
async fn get_community(mut request: Request) -> tide::Result {
let data = request.layout_data().await?;
Ok(tide::Response::builder(200)
.body(request.state().render_template("community.hbs", &data)?)
.content_type(mime::HTML)
.build())
}