Add "Enqueue" button to commits

This commit is contained in:
Joscha 2023-08-11 16:50:32 +02:00
parent 5e0b8e3c8c
commit 48693d3f1c
4 changed files with 41 additions and 3 deletions

View file

@ -6,7 +6,10 @@ mod queue;
mod r#static;
mod worker;
use axum::{routing::get, Router};
use axum::{
routing::{get, post},
Router,
};
use crate::{config::Config, somehow};
@ -46,9 +49,10 @@ pub async fn run(server: Server) -> somehow::Result<()> {
let app = Router::new()
.route("/", get(index::get))
.route("/commit/:hash", get(commit::get))
.route("/worker/:name", get(worker::get))
.route("/commit/:hash/enqueue", post(commit::post_enqueue))
.route("/queue/", get(queue::get))
.route("/queue/inner", get(queue::get_inner))
.route("/worker/:name", get(worker::get))
.merge(api::router(&server))
.fallback(get(r#static::static_handler))
.with_state(server.clone());