Extend the app state

This commit is contained in:
Lennart
2023-09-05 17:00:32 +02:00
parent a87425f632
commit 6b6788ec98
8 changed files with 94 additions and 23 deletions

View File

@@ -9,6 +9,7 @@ use clap::Parser;
use config::{CalendarStoreConfig, JsonCalendarStoreConfig};
use rustical_api::configure_api;
use rustical_dav::{configure_dav, configure_well_known};
use rustical_frontend::configure_frontend;
use rustical_store::calendar::JsonCalendarStore;
use tokio::sync::RwLock;
@@ -45,9 +46,9 @@ async fn main() -> Result<()> {
App::new()
.wrap(Logger::new("[%s] %r"))
.wrap(NormalizePath::trim())
.service(
web::scope("/dav").configure(|cfg| configure_dav(cfg, cal_store.clone().into())),
)
.service(web::scope("/caldav").configure(|cfg| {
configure_dav(cfg, "/caldav".to_string(), cal_store.clone().into())
}))
.service(
web::scope("/.well-known")
.configure(|cfg| configure_well_known(cfg, "/dav".to_string())),
@@ -55,6 +56,10 @@ async fn main() -> Result<()> {
.service(
web::scope("/api").configure(|cfg| configure_api(cfg, cal_store.clone().into())),
)
.service(
web::scope("/frontend")
.configure(|cfg| configure_frontend(cfg, cal_store.clone().into())),
)
})
.bind(("0.0.0.0", 4000))?
.run()