A static web page is served as stored content and presents the same page to each visitor. A bank homepage is a typical example; personalized account balances are dynamic, though they may share static elements such as logos and styling. section 7.1
use actix_files as fs; #1
use actix_web::{error, web, App, Error, HttpResponse, HttpServer, Result};
#[actix_web::main]
async fn main() -> std::io::Result<()> { #2
let addr = env::var("SERVER_ADDR").unwrap_or_else(|_|
"127.0.0.1:8080".to_string());
println!("Listening on: {}, open browser and visit have a try!",addr);
HttpServer::new(|| {
App::new().service(fs::Files::new(
"/static", "./static").show_files_listing()) #3
})
.bind(addr)? #4
.run() #5
.await #6
}
An Actix server can mount a directory at `/static` and serve files from it. Place an HTML page in that directory, then request it at a matching URL. section 7.2
A template engine turns a static template into dynamic HTML by inserting data supplied by the web application. Static pages can also be served by a custom Rust HTTP server built on the standard library. section 7.1 section 2.4

