fix: invalid borrowing of assets_path in get_router
This commit is contained in:
@ -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())
|
||||
|
Reference in New Issue
Block a user