17 lines
618 B
Rust
17 lines
618 B
Rust
|
use elseware::patch::patch::{PatchServerState, generate_patch_tree, load_config, load_motd};
|
||
|
use log::{info};
|
||
|
use elseware::common::mainloop::patch_mainloop;
|
||
|
|
||
|
fn main() {
|
||
|
info!("[patch] starting server");
|
||
|
let patch_config = load_config();
|
||
|
let patch_motd = load_motd();
|
||
|
let (patch_file_tree, patch_file_lookup) = generate_patch_tree(patch_config.path.as_str());
|
||
|
let patch_state = PatchServerState::new(patch_file_tree, patch_file_lookup, patch_motd);
|
||
|
let patch_loop = patch_mainloop(patch_state, patch_config.port);
|
||
|
|
||
|
async_std::task::block_on(async move {
|
||
|
patch_loop.await
|
||
|
});
|
||
|
}
|