mirror of
https://github.com/perstarkse/minne.git
synced 2026-07-05 04:21:38 +02:00
refactor: better separation of dependencies to crates
node stuff to html crate only
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
pub mod handlers;
|
||||
|
||||
use axum::{
|
||||
extract::FromRef,
|
||||
routing::{delete, get},
|
||||
Router,
|
||||
};
|
||||
use handlers::{delete_job, delete_text_content, index_handler, show_active_jobs};
|
||||
|
||||
use crate::html_state::HtmlState;
|
||||
|
||||
pub fn public_router<S>() -> Router<S>
|
||||
where
|
||||
S: Clone + Send + Sync + 'static,
|
||||
HtmlState: FromRef<S>,
|
||||
{
|
||||
Router::new().route("/", get(index_handler))
|
||||
}
|
||||
|
||||
pub fn protected_router<S>() -> Router<S>
|
||||
where
|
||||
S: Clone + Send + Sync + 'static,
|
||||
HtmlState: FromRef<S>,
|
||||
{
|
||||
Router::new()
|
||||
.route("/jobs/:job_id", delete(delete_job))
|
||||
.route("/active-jobs", get(show_active_jobs))
|
||||
.route("/text-content/:id", delete(delete_text_content))
|
||||
}
|
||||
Reference in New Issue
Block a user