tmpmail/src/main.rs

29 lines
528 B
Rust
Raw Normal View History

2023-07-02 19:59:25 +02:00
extern crate rouille;
extern crate rand;
use std::thread;
mod http;
mod random_names;
mod state;
mod smtp;
fn main() {
println!("Starting on localhost:8005");
let state = state::fresh_state();
let http_thread = thread::spawn(|| {
rouille::start_server("localhost:8005", move |request| {
http::http_handler(request, &state)
})
});
let smtp_thread = thread::spawn(|| {
smtp::start_server();
});
http_thread.join().unwrap();
smtp_thread.join().unwrap();
}