blob: d5e083df8719669f30f310ef55d01be79869ca43 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
use std::net::IpAddr;
use eyre::Result;
use crate::settings::Settings;
pub mod auth;
pub mod database;
pub mod handlers;
pub mod models;
pub mod router;
pub async fn launch(settings: &Settings, host: String, port: u16) -> Result<()> {
// routes to run:
// index, register, add_history, login, get_user, sync_count, sync_list
let host = host.parse::<IpAddr>()?;
let r = router::router(settings).await?;
warp::serve(r).run((host, port)).await;
Ok(())
}
|