mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 16:32:29 +00:00
clean up main.rs
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -38,14 +38,20 @@ async fn main() -> Result<()> {
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
let auth = match config.auth {
|
||||||
|
config::AuthConfig::Htpasswd(config) => 1,
|
||||||
|
_ => panic!("invalid auth config"),
|
||||||
|
};
|
||||||
|
|
||||||
HttpServer::new(move || {
|
HttpServer::new(move || {
|
||||||
let cal_store = cal_store.clone();
|
let cal_store = cal_store.clone();
|
||||||
App::new()
|
App::new()
|
||||||
.wrap(Logger::new("[%s] %r"))
|
.wrap(Logger::new("[%s] %r"))
|
||||||
.wrap(NormalizePath::trim())
|
.wrap(NormalizePath::trim())
|
||||||
.service(web::scope("/caldav").configure(|cfg| {
|
.service(
|
||||||
configure_dav(cfg, "/caldav".to_string(), cal_store.clone().into())
|
web::scope("/caldav")
|
||||||
}))
|
.configure(|cfg| configure_dav(cfg, "/caldav".to_string(), cal_store.clone())),
|
||||||
|
)
|
||||||
.service(
|
.service(
|
||||||
web::scope("/.well-known")
|
web::scope("/.well-known")
|
||||||
.configure(|cfg| configure_well_known(cfg, "/dav".to_string())),
|
.configure(|cfg| configure_well_known(cfg, "/dav".to_string())),
|
||||||
|
|||||||
Reference in New Issue
Block a user