make the command line a bit more accessible by including a :| icon at the bottom

also add a few extra commands for navigating around the house
This commit is contained in:
りき萌 2024-12-10 20:40:44 +01:00
parent 7c93750b32
commit 6d3037791a
9 changed files with 169 additions and 104 deletions

View file

@ -5,6 +5,7 @@ mod picture_upload;
use std::fmt::Write;
use std::{net::Ipv4Addr, sync::Arc};
use axum::http::header::LOCATION;
use axum::{
extract::{Path, Query, RawQuery, State},
http::{
@ -49,6 +50,7 @@ pub async fn serve(
.route("/", get(index)) // needed explicitly because * does not match empty paths
.route("/*path", get(vfs_entry))
.route("/b", get(branch))
.route("/treehouse/quit", get(quit))
.fallback(get(four_oh_four))
.with_state(Arc::new(Server {
sources: sources.clone(),
@ -196,3 +198,12 @@ async fn branch(RawQuery(named_id): RawQuery, State(state): State<Arc<Server>>)
system_page(&state.target, system::B_DOCS, StatusCode::OK).await
}
}
async fn quit() -> impl IntoResponse {
info!("somebody just quit the treehouse. congration to them!");
(
StatusCode::FOUND,
[(LOCATION, "https://www.youtube.com/watch?v=dQw4w9WgXcQ")],
)
}