global: snapshot

This commit is contained in:
nym21
2025-08-03 23:38:58 +02:00
parent f7aa9424db
commit a2f5704581
50 changed files with 818 additions and 704 deletions
+5 -5
View File
@@ -1,20 +1,20 @@
use std::path::PathBuf;
use axum::{Router, routing::get};
use super::AppState;
mod file;
mod website;
use file::{file_handler, index_handler};
pub use website::Website;
pub trait FilesRoutes {
fn add_website_routes(self, website: Website) -> Self;
fn add_files_routes(self, path: Option<&PathBuf>) -> Self;
}
impl FilesRoutes for Router<AppState> {
fn add_website_routes(self, website: Website) -> Self {
if website.is_some() {
fn add_files_routes(self, path: Option<&PathBuf>) -> Self {
if path.is_some() {
self.route("/{*path}", get(file_handler))
.route("/", get(index_handler))
} else {