html terminal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#![feature(utf8_chunks)]

use std::str::FromStr;

#[macro_use]
mod logging;
mod process;
mod server;

use process::*;
use server::*;
use std::net::SocketAddr;

#[tokio::main]
async fn main() {
    let process = Process::spawn(
        std::env::var("SERVER_DIR")
            .unwrap_or("~/mserv".replace("~", &std::env::var("HOME").unwrap_or("/root".into())))
            .into(),
    );
    Server::spawn(
        SocketAddr::from((
            [0, 0, 0, 0],
            std::env::var("PORT").map_or(4001, |x| u16::from_str(&x).unwrap()),
        )),
        process,
    )
    .await;
}