diff --git a/src/main.rs b/src/main.rs index e7a11a9..2aea481 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,21 @@ -fn main() { - println!("Hello, world!"); +mod html; +mod pages; + +use actix_web::{App, HttpServer}; + +use pages::{files::file, index}; + +#[actix_web::main] +async fn main() { + let bind_address = "0.0.0.0:8080"; + if let Ok(server) = + HttpServer::new(|| App::new().service(index).service(file)).bind(bind_address) + { + match server.run().await { + Ok(_) => {} + Err(e) => { + eprintln!("An error occurred: {}", e); + } + } + } }