Implémentation "HATEOAS" de l'interface pour HTMX et update des URLs qui fonctionne ! #57
@ -1,6 +1,3 @@
|
|||||||
mod pages;
|
|
||||||
mod templates;
|
|
||||||
|
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use askama_axum::Template;
|
use askama_axum::Template;
|
||||||
@ -23,7 +20,7 @@ pub fn get_router(assets_path: &Path) -> axum::Router {
|
|||||||
axum::Router::new()
|
axum::Router::new()
|
||||||
.nest_service("/assets", ServeDir::new(assets_path))
|
.nest_service("/assets", ServeDir::new(assets_path))
|
||||||
.route("/", axum::routing::get(root))
|
.route("/", axum::routing::get(root))
|
||||||
.nest("/pages", pages::get_routes())
|
// .nest("/pages", old_pages::get_routes())
|
||||||
.merge(templates::get_routes())
|
// .merge(old_templates::get_routes())
|
||||||
.fallback(fallback)
|
.fallback(fallback)
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,17 @@
|
|||||||
use ::app::get_router;
|
use std::path::Path;
|
||||||
|
use std::{env, io};
|
||||||
|
|
||||||
use axum::body::Body;
|
use axum::body::Body;
|
||||||
use axum::http::Request;
|
use axum::http::Request;
|
||||||
use listenfd::ListenFd;
|
use listenfd::ListenFd;
|
||||||
use notify::Watcher;
|
use notify::Watcher;
|
||||||
use std::path::Path;
|
|
||||||
use std::{env, io};
|
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
use tokio::net::TcpListener;
|
use tokio::net::TcpListener;
|
||||||
use tower_livereload::predicate::Predicate;
|
use tower_livereload::predicate::Predicate;
|
||||||
use tower_livereload::LiveReloadLayer;
|
use tower_livereload::LiveReloadLayer;
|
||||||
|
|
||||||
|
use ::app::get_router;
|
||||||
|
|
||||||
#[derive(Error, Debug)]
|
#[derive(Error, Debug)]
|
||||||
pub enum AppError {
|
pub enum AppError {
|
||||||
#[error("Unable to bind to TCP listener")]
|
#[error("Unable to bind to TCP listener")]
|
||||||
|
Loading…
Reference in New Issue
Block a user