mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-22 16:38:11 -07:00
global: snapshot
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user