use std::convert::From;
+use std::env;
use std::io::Cursor;
use std::fmt::Display;
use std::fmt;
#[actix_web::main] // or #[tokio::main]
async fn main() -> std::io::Result<()> {
env_logger::init();
+ let listenaddress = env::args().nth(1).unwrap_or_else(|| "127.0.0.1:8080".to_string());
let canvas0 = Arc::new(Mutex::new(Canvas0(Some(Canvas::new(32, 32)))));
let canvas1 = Arc::new(Mutex::new(Canvas1(None)));
let canvas2 = Arc::new(Mutex::new(Canvas2(None)));
.app_data(web::Data::new(canvas1.clone()))
.app_data(web::Data::new(canvas2.clone()))
})
- .bind(("127.0.0.1", 8080))?
+ .bind(listenaddress)?
.run()
.await
}