feat: Rewrite routes, pages and components to be more HATEOAS
This commit is contained in:
@ -4,6 +4,9 @@ use askama_axum::Template;
|
||||
use axum::http::{StatusCode, Uri};
|
||||
use tower_http::services::ServeDir;
|
||||
|
||||
mod menu;
|
||||
mod pages;
|
||||
|
||||
async fn fallback(uri: Uri) -> (StatusCode, String) {
|
||||
(StatusCode::NOT_FOUND, format!("No route for {uri}"))
|
||||
}
|
||||
@ -20,7 +23,6 @@ pub fn get_router(assets_path: &Path) -> axum::Router {
|
||||
axum::Router::new()
|
||||
.nest_service("/assets", ServeDir::new(assets_path))
|
||||
.route("/", axum::routing::get(root))
|
||||
// .nest("/pages", old_pages::get_routes())
|
||||
// .merge(old_templates::get_routes())
|
||||
.merge(pages::get_routes())
|
||||
.fallback(fallback)
|
||||
}
|
||||
|
Reference in New Issue
Block a user