tmpmail/src/main.rs

29 lines
528 B
Rust
Raw Normal View History

2023-07-02 19:59:25 +02:00
extern crate rand;
2023-07-02 20:18:43 +02:00
extern crate rouille;
2023-07-02 19:59:25 +02:00
use std::thread;
mod http;
mod random_names;
mod smtp;
2023-07-02 20:18:43 +02:00
mod state;
2023-07-02 19:59:25 +02:00
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();
}