feat: Implement dedicated 404 page for routes under /_continuwuity/

This commit is contained in:
Ginger
2026-03-04 11:18:07 -05:00
parent 43aa172829
commit eec7103910
6 changed files with 24 additions and 14 deletions
+2 -6
View File
@@ -2,17 +2,13 @@ use askama::Template;
use axum::{
Router,
extract::State,
response::{Html, IntoResponse, Redirect},
response::{Html, IntoResponse},
routing::get,
};
use crate::WebError;
pub(crate) fn build() -> Router<crate::State> {
Router::new()
.route("/", get(async || Redirect::permanent("/_continuwuity/")))
.route("/_continuwuity/", get(index_handler))
}
pub(crate) fn build() -> Router<crate::State> { Router::new().route("/", get(index_handler)) }
async fn index_handler(
State(services): State<crate::State>,
+2 -2
View File
@@ -6,7 +6,6 @@ use axum::{
response::{Html, IntoResponse, Response},
routing::get,
};
use conduwuit_service::password_reset::PASSWORD_RESET_PATH;
use serde::Deserialize;
use validator::Validate;
@@ -54,7 +53,8 @@ form! {
}
pub(crate) fn build() -> Router<crate::State> {
Router::new().route(PASSWORD_RESET_PATH, get(get_password_reset).post(post_password_reset))
Router::new()
.route("/account/reset_password", get(get_password_reset).post(post_password_reset))
}
async fn password_reset_form(
+1 -1
View File
@@ -2,7 +2,7 @@ use axum::Router;
pub(crate) fn build() -> Router<crate::State> {
Router::new().nest(
"/_continuwuity/resources/",
"/resources/",
#[allow(unused_qualifications)]
memory_serve::load!().index_file(None).into_router(),
)
+8 -1
View File
@@ -21,7 +21,14 @@
 \二つ
</pre>
<div class="panel">
<h1>Request error<small aria-hidden>(︶^︶)</small></h1>
<h1>
{% if status == StatusCode::NOT_FOUND %}
Not found
{% else %}
Request error
{% endif %}
<small aria-hidden>(︶^︶)</small>
</h1>
<pre><code>{{ error }}</code></pre>
</div>