Added routes to app

This commit is contained in:
2025-10-05 23:29:29 +02:00
parent 71911f2662
commit cba44c144d

View File

@@ -1,3 +1,21 @@
fn main() { mod html;
println!("Hello, world!"); 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);
}
}
}
} }