snix/services/nixcon-demo/src/main.rs
Vincent Ambo 161f1b5e85 feat(nixcon-demo): Add CLI mode for NixCon demo
Maybe a bit more sane than trying to do a network based setup.
2019-10-26 13:50:42 +02:00

19 lines
412 B
Rust

use rouille::Response;
use std::env;
use std::io;
use std::process;
const GREETING: &str = "Haló NixCon!";
fn main() {
if let Some(arg) = env::args().last() {
if arg == "--cli" {
println!("{}", GREETING);
process::exit(0);
}
}
rouille::start_server("0.0.0.0:8080", move |req| {
rouille::log(req, io::stdout(), || Response::text(GREETING))
})
}