You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use actix_web::{App, fs};fnmain(){App::new().handler("/static",
fs::StaticFiles::new(".").unwrap().show_files_listing()).finish();}
Needs to actually run a server to do anything:
use actix_web::{App, fs, server};fnmain(){
server::new(|| App::new().handler("/static",
fs::StaticFiles::new(".").unwrap().show_files_listing())).bind("127.0.0.1:8888").expect("Can not bind to port 8888").run()}
Lots of other examples have the same problem, in various chapters. I sympathize with wanting to keep noise low, but I would argue you also want your examples to either actually do something when run, or not compile.
The text was updated successfully, but these errors were encountered:
For example, the directory example:
Needs to actually run a
server
to do anything:Lots of other examples have the same problem, in various chapters. I sympathize with wanting to keep noise low, but I would argue you also want your examples to either actually do something when run, or not compile.
The text was updated successfully, but these errors were encountered: