mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-13 12:08:13 -07:00
global: snapshot
This commit is contained in:
@@ -46,7 +46,7 @@ fn any_handler(
|
||||
.websites_path
|
||||
.as_ref()
|
||||
.expect("Should never reach here is websites_path is None")
|
||||
.join(app_state.frontend.to_folder_name());
|
||||
.join(app_state.website.to_folder_name());
|
||||
|
||||
let instant = Instant::now();
|
||||
|
||||
|
||||
@@ -3,19 +3,19 @@ use axum::{Router, routing::get};
|
||||
use super::AppState;
|
||||
|
||||
mod file;
|
||||
mod frontend;
|
||||
mod minify;
|
||||
mod website;
|
||||
|
||||
use file::{file_handler, index_handler};
|
||||
pub use frontend::Frontend;
|
||||
pub use website::Website;
|
||||
|
||||
pub trait FilesRoutes {
|
||||
fn add_website_routes(self, frontend: Frontend) -> Self;
|
||||
fn add_website_routes(self, website: Website) -> Self;
|
||||
}
|
||||
|
||||
impl FilesRoutes for Router<AppState> {
|
||||
fn add_website_routes(self, frontend: Frontend) -> Self {
|
||||
if frontend.is_some() {
|
||||
fn add_website_routes(self, website: Website) -> Self {
|
||||
if website.is_some() {
|
||||
self.route("/{*path}", get(file_handler))
|
||||
.route("/", get(index_handler))
|
||||
} else {
|
||||
|
||||
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||
#[derive(
|
||||
Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize, ValueEnum,
|
||||
)]
|
||||
pub enum Frontend {
|
||||
pub enum Website {
|
||||
#[default]
|
||||
None,
|
||||
#[value(name = "kibo.money")]
|
||||
@@ -12,7 +12,7 @@ pub enum Frontend {
|
||||
Custom,
|
||||
}
|
||||
|
||||
impl Frontend {
|
||||
impl Website {
|
||||
pub fn is_none(&self) -> bool {
|
||||
self == &Self::None
|
||||
}
|
||||
Reference in New Issue
Block a user