Skip to content

Commit

Permalink
Add faucet routes for favicon and background
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirko-von-Leipzig committed Feb 7, 2025
1 parent 87b4a70 commit e87a6aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions bin/faucet/src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ pub async fn get_index_css(state: State<FaucetState>) -> Result<impl IntoRespons
get_static_file(state, "index.css")
}

pub async fn get_background(state: State<FaucetState>) -> Result<impl IntoResponse, HandlerError> {
get_static_file(state, "background.png")
}

pub async fn get_favicon(state: State<FaucetState>) -> Result<impl IntoResponse, HandlerError> {
get_static_file(state, "favicon.ico")
}

/// Returns a static file bundled with the app state.
///
/// # Panics
Expand Down
4 changes: 3 additions & 1 deletion bin/faucet/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use axum::{
};
use clap::{Parser, Subcommand};
use client::initialize_faucet_client;
use handlers::{get_index_css, get_index_html, get_index_js};
use handlers::{get_background, get_favicon, get_index_css, get_index_html, get_index_js};
use http::HeaderValue;
use miden_lib::{account::faucets::create_basic_fungible_faucet, AuthScheme};
use miden_node_utils::{config::load_config, crypto::get_rpo_random_coin, version::LongVersion};
Expand Down Expand Up @@ -106,6 +106,8 @@ async fn main() -> anyhow::Result<()> {
.route("/", get(get_index_html))
.route("/index.js", get(get_index_js))
.route("/index.css", get(get_index_css))
.route("/background.jpg", get(get_background))
.route("/favicon.ico", get(get_favicon))
.route("/get_metadata", get(get_metadata))
.route("/get_tokens", post(get_tokens))
.layer(
Expand Down

0 comments on commit e87a6aa

Please sign in to comment.