mirror of
https://github.com/perstarkse/minne.git
synced 2026-06-25 19:36:20 +02:00
41 lines
1.1 KiB
Rust
41 lines
1.1 KiB
Rust
mod handlers;
|
|
use axum::{
|
|
Router,
|
|
extract::FromRef,
|
|
routing::{delete, get, patch, post},
|
|
};
|
|
|
|
use crate::html_state::HtmlState;
|
|
|
|
pub fn router<S>() -> Router<S>
|
|
where
|
|
S: Clone + Send + Sync + 'static,
|
|
HtmlState: FromRef<S>,
|
|
{
|
|
Router::new()
|
|
.route("/scratchpad", get(handlers::show_scratchpad_page))
|
|
.route("/scratchpad", post(handlers::create_scratchpad))
|
|
.route(
|
|
"/scratchpad/{id}/modal",
|
|
get(handlers::show_scratchpad_modal),
|
|
)
|
|
.route(
|
|
"/scratchpad/{id}/auto-save",
|
|
patch(handlers::auto_save_scratchpad),
|
|
)
|
|
.route(
|
|
"/scratchpad/{id}/title",
|
|
patch(handlers::update_scratchpad_title),
|
|
)
|
|
.route("/scratchpad/{id}", delete(handlers::delete_scratchpad))
|
|
.route(
|
|
"/scratchpad/{id}/archive",
|
|
post(handlers::archive_scratchpad),
|
|
)
|
|
.route("/scratchpad/{id}/ingest", post(handlers::ingest_scratchpad))
|
|
.route(
|
|
"/scratchpad/{id}/restore",
|
|
post(handlers::restore_scratchpad),
|
|
)
|
|
}
|