This is a sample HTML document to demonstrate the basic structure of an HTML page. You can use this as a starting point for your own web projects.
+
About
+
Learn more about the purpose of this website and the content it provides.
+
Contact
+
If you have any questions or comments, feel free to reach out through the contact form.
+
+
+
+
diff --git a/fedimint-nwc/frontend/assets/script.js b/fedimint-nwc/frontend/assets/script.js
new file mode 100644
index 0000000..e69de29
diff --git a/fedimint-nwc/src/main.rs b/fedimint-nwc/src/main.rs
index ee6b852..ddf3ffc 100644
--- a/fedimint-nwc/src/main.rs
+++ b/fedimint-nwc/src/main.rs
@@ -1,16 +1,18 @@
use anyhow::Result;
use clap::Parser;
use nostr_sdk::{JsonUtil, Kind, RelayPoolNotification};
-use tokio::pin;
+use tokio::{pin, task};
use tracing::{error, info};
pub mod config;
pub mod database;
pub mod nwc;
pub mod services;
-pub mod state;
+pub mod state;
+use axum::Router;
use state::AppState;
+use tower_http::services::ServeDir;
use crate::config::Cli;
@@ -28,6 +30,17 @@ async fn main() -> Result<()> {
state.nostr_service.connect().await;
state.nostr_service.broadcast_info_event().await?;
+ let server = Router::new().nest_service("/", ServeDir::new("frontend/assets"));
+ let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
+
+ // Spawn a new Tokio task for the server
+ let server_task = task::spawn(async move {
+ axum::serve(listener, server).await.unwrap();
+ });
+
+ // Wait for the server task to complete if necessary
+ server_task.await?;
+
// Start the event loop
event_loop(state.clone()).await?;