about summary refs log blame commit diff
path: root/services/nixcon-demo/src/main.rs
blob: 226fe49ed1a30c830edd789cfd18392bd27dabb8 (plain) (tree)
1
2
3
4
5
6
7
8
                      




                                       

           






                                           
                                                      
                                                                    

      
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))
    })
}