aboutsummaryrefslogtreecommitdiff
path: root/lib/go_vanity/src/lib.rs
blob: 756c5553f3897089e51ee384103e981ca1e93078 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
use crate::templates::RenderRucte;
use warp::{http::Response, Rejection, Reply};

include!(concat!(env!("OUT_DIR"), "/templates.rs"));

pub async fn gitea(pkg_name: &str, git_repo: &str, branch: &str) -> Result<impl Reply, Rejection> {
    Response::builder().html(|o| templates::gitea_html(o, pkg_name, git_repo, branch))
}

pub async fn github(pkg_name: &str, git_repo: &str, branch: &str) -> Result<impl Reply, Rejection> {
    Response::builder().html(|o| templates::github_html(o, pkg_name, git_repo, branch))
}