Refactoring de l'interface : migration d'un monolithe HTMx vers un client Nuxt + serveur Axum #66

Merged
florian_briand merged 10 commits from feat/65_move_out_htmx_with_axum_backend_and_nuxt_frontend into main 2024-09-24 12:53:14 +02:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit 71ea6423bc - Show all commits

View File

@ -1,4 +1,4 @@
use std::path::Path;
use std::path::PathBuf;
use axum::http::{StatusCode, Uri};
use axum_htmx::AutoVaryLayer;
@ -11,7 +11,7 @@ async fn fallback(uri: Uri) -> (StatusCode, String) {
(StatusCode::NOT_FOUND, format!("No route for {uri}"))
}
pub fn get_router(assets_path: &Path) -> axum::Router {
pub async fn get_router(assets_path: PathBuf) -> axum::Router<()> {
axum::Router::new()
.nest_service("/assets", ServeDir::new(assets_path))
.merge(pages::get_routes())

View File

@ -72,7 +72,7 @@ async fn main() -> Result<(), AppError> {
let livereload_layer =
get_livereload_layer(templates_paths).map_err(AppError::NotifyWatcher)?;
let router = get_router(assets_path.as_path()).layer(livereload_layer);
let router = get_router(assets_path).await.layer(livereload_layer);
let listener: TcpListener = get_tcp_listener().await.map_err(AppError::TCPListener)?;
let local_addr = listener.local_addr().map_err(AppError::TCPListener)?;