aboutsummaryrefslogtreecommitdiff
path: root/src/cli/run_server.rs
blob: 9e4d91c9cedb656dfee3c53c9b4ada369ea112fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use structopt::StructOpt;

use crate::{Settings, UrlMap};

#[derive(StructOpt)]
pub struct RunServer {

}

impl RunServer {
    pub fn execute(self, urls: UrlMap, _settings: Settings) {
        let server_task = warp::serve(urls).run(([127, 0, 0, 1], 3030));

        tokio::runtime::Builder::new_multi_thread()
            .enable_all()
            .build()
            .unwrap()
            .block_on(server_task)
    }
}