Move all crates to a top-level crates folder
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
parent
d768224182
commit
fdfed3d7db
282 changed files with 195588 additions and 16 deletions
15
crates/server/src/community.rs
Normal file
15
crates/server/src/community.rs
Normal 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())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue