Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(faucet): missing background and favicon routes #672

Merged
merged 1 commit into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixes

- Faucet webpage is missing `background.png` and `favicon.ico` (#672).

### Enhancements

- Add an optional open-telemetry trace exporter (#659).
Expand Down
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.png", get(get_background))
.route("/favicon.ico", get(get_favicon))
.route("/get_metadata", get(get_metadata))
.route("/get_tokens", post(get_tokens))
.layer(
Expand Down
Loading