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
30
use std::net::IpAddr;
use eyre::Result;
use crate::settings::Settings;
#[macro_use]
extern crate log;
#[macro_use]
extern crate serde_derive;
pub mod auth;
pub mod database;
pub mod handlers;
pub mod models;
pub mod router;
pub mod settings;
pub async fn launch(settings: &Settings, host: String, port: u16) -> Result<()> {
let host = host.parse::<IpAddr>()?;
let r = router::router(settings).await?;
warp::serve(r).run((host, port)).await;
Ok(())
}