Add file and error handler

This commit is contained in:
2024-03-01 14:50:42 -05:00
parent 939b14403f
commit 57fd838e10
3 changed files with 43 additions and 0 deletions

View File

@ -18,6 +18,7 @@ async fn main() {
use leptos::*;
use leptos_axum::{generate_route_list, LeptosRoutes};
use libretunes::app::*;
use libretunes::fileserv::file_and_error_handler;
use dotenv::dotenv;
dotenv().ok();
@ -35,6 +36,7 @@ async fn main() {
let app = Router::new()
.leptos_routes(&leptos_options, routes, App)
.fallback(file_and_error_handler)
.with_state(leptos_options);
println!("listening on http://{}", &addr);