Move server code into its own module

This commit is contained in:
Joscha 2023-08-07 14:23:47 +02:00
parent ad0c1a69cb
commit 45abda2b6d
12 changed files with 15 additions and 4 deletions

18
src/server/web/commit.rs Normal file
View file

@ -0,0 +1,18 @@
use askama::Template;
use axum::{extract::State, response::IntoResponse};
use crate::{config::Config, somehow};
use super::{Base, Tab};
#[derive(Template)]
#[template(path = "commit.html")]
struct CommitTemplate {
base: Base,
}
pub async fn get(State(config): State<&'static Config>) -> somehow::Result<impl IntoResponse> {
Ok(CommitTemplate {
base: Base::new(config, Tab::Commit),
})
}