diff --git a/src/main.rs b/src/main.rs index 1480b3c..e746b64 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,13 +1,18 @@ -/////////////////////////////////////////// -// // -// TO EDIT NETWORK STUFF EDIT BELOW: // -// - const IPADDRESS // -// - const PORT // -// // -/////////////////////////////////////////// +///////////////////////////////////// +// // +// TO EDIT NETWORK STUFF EDIT: // +// - const IPADDRESS // +// - const PORT // +// // +// TO EDIT FONT: // +// - Add your font to root dir // +// - edit const FONTFILENAME // +// // +///////////////////////////////////// -const IPADDRESS: &str = "69"; +const IPADDRESS: &str = "0.0.0.0"; const PORT: &str = "8080"; +const FONTFILENAME: &str = "Roboto-Regular.ttf" use std::{io::Cursor, net::SocketAddr}; @@ -19,12 +24,15 @@ use imageproc::drawing::{self, text_size}; #[tokio::main] async fn main() { - let fontfile = include_bytes!("../Roboto-Regular.ttf"); + let networkaddress = format!("{IPADDRESS}:{PORT}"); + let fontname2 = format!("../{FONTFILENAME}") + + let fontfile = include_bytes!(fontname2); let font = FontRef::try_from_slice(fontfile).unwrap(); let app = Router::new().route("/ip.png", get(ip_png)).with_state(font); - let list = tokio::net::TcpListener::bind("0.0.0.0:8080").await.unwrap(); + let list = tokio::net::TcpListener::bind(networkaddress).await.unwrap(); axum::serve( list, app.into_make_service_with_connect_info::(),